File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,24 +48,12 @@ export function registerBrowserUtilityTools(server: McpServer) {
4848 const client = createKernelClient ( extra . authInfo . token ) ;
4949
5050 try {
51- validateCurlUrl ( params . url ) ;
51+ const { session_id, ...curlParams } = params satisfies {
52+ session_id : string ;
53+ } & BrowserCurlParams ;
54+ validateCurlUrl ( curlParams . url ) ;
5255
53- const curlParams : BrowserCurlParams = {
54- url : params . url ,
55- ...( params . method !== undefined && { method : params . method } ) ,
56- ...( params . headers !== undefined && { headers : params . headers } ) ,
57- ...( params . body !== undefined && { body : params . body } ) ,
58- ...( params . response_encoding !== undefined && {
59- response_encoding : params . response_encoding ,
60- } ) ,
61- ...( params . timeout_ms !== undefined && {
62- timeout_ms : params . timeout_ms ,
63- } ) ,
64- } ;
65- const response = await client . browsers . curl (
66- params . session_id ,
67- curlParams ,
68- ) ;
56+ const response = await client . browsers . curl ( session_id , curlParams ) ;
6957 return textResponse ( JSON . stringify ( response , null , 2 ) ) ;
7058 } catch ( error ) {
7159 return textResponse (
You can’t perform that action at this time.
0 commit comments