File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,14 @@ async function run() {
7676 CallToolResultSchema ,
7777 ) ;
7878 console . log ( 'Tool result:' , JSON . stringify ( result ) ) ;
79+
80+ await client . close ( ) ;
7981 } catch ( error ) {
8082 console . error ( 'Error:' , error ) ;
8183 }
8284}
8385
8486run ( ) . catch ( ( error ) => {
85- console . error ( 'Unhandled error:' , error ) ;
87+ console . error ( `Error running MCP client: ${ error as Error } ` ) ;
8688 process . exit ( 1 ) ;
8789} ) ;
Original file line number Diff line number Diff line change 99
1010import log from '@apify/log' ;
1111
12+ import { HelperTools } from '../const.js' ;
13+
1214log . setLevel ( log . LEVELS . DEBUG ) ;
1315
1416async function main ( ) : Promise < void > {
@@ -65,7 +67,7 @@ async function callSearchTool(client: Client): Promise<void> {
6567 const searchRequest : CallToolRequest = {
6668 method : 'tools/call' ,
6769 params : {
68- name : 'search' ,
70+ name : HelperTools . SEARCH_ACTORS ,
6971 arguments : { search : 'rag web browser' , limit : 1 } ,
7072 } ,
7173 } ;
@@ -104,6 +106,6 @@ async function callActor(client: Client): Promise<void> {
104106}
105107
106108main ( ) . catch ( ( error : unknown ) => {
107- log . error ( ' Error running MCP client:' , error as Error ) ;
109+ log . error ( ` Error running MCP client: ${ error as Error } ` ) ;
108110 process . exit ( 1 ) ;
109111} ) ;
You can’t perform that action at this time.
0 commit comments