File tree Expand file tree Collapse file tree 8 files changed +703
-78
lines changed Expand file tree Collapse file tree 8 files changed +703
-78
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ client/tsconfig.app.tsbuildinfo
99client /tsconfig.node.tsbuildinfo
1010cli /build
1111test-output
12+ tool-test-output
1213# symlinked by `npm run link:sdk`:
1314sdk
1415client /playwright-report /
Original file line number Diff line number Diff line change @@ -395,6 +395,9 @@ npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/lis
395395# Call a specific tool
396396npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg key=value --tool-arg another=value2
397397
398+ # Call a tool with JSON arguments
399+ npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg ' options={"format": "json", "max_tokens": 100}'
400+
398401# List available resources
399402npx @modelcontextprotocol/inspector --cli node build/index.js --method resources/list
400403
Original file line number Diff line number Diff line change 1717 "scripts" : {
1818 "build" : " tsc" ,
1919 "postbuild" : " node scripts/make-executable.js" ,
20- "test" : " node scripts/cli-tests.js"
20+ "test" : " node scripts/cli-tests.js && node scripts/cli-tool-tests.js" ,
21+ "test:cli" : " node scripts/cli-tests.js" ,
22+ "test:cli-tools" : " node scripts/cli-tool-tests.js"
2123 },
2224 "devDependencies" : {},
2325 "dependencies" : {
Original file line number Diff line number Diff line change @@ -37,9 +37,6 @@ console.log(`${colors.BLUE}- Environment variables (-e)${colors.NC}`);
3737console . log ( `${ colors . BLUE } - Config file (--config)${ colors . NC } ` ) ;
3838console . log ( `${ colors . BLUE } - Server selection (--server)${ colors . NC } ` ) ;
3939console . log ( `${ colors . BLUE } - Method selection (--method)${ colors . NC } ` ) ;
40- console . log (
41- `${ colors . BLUE } - Tool-related options (--tool-name, --tool-arg)${ colors . NC } ` ,
42- ) ;
4340console . log ( `${ colors . BLUE } - Resource-related options (--uri)${ colors . NC } ` ) ;
4441console . log (
4542 `${ colors . BLUE } - Prompt-related options (--prompt-name, --prompt-args)${ colors . NC } ` ,
@@ -533,65 +530,6 @@ async function runTests() {
533530 "tools/list" ,
534531 ) ;
535532
536- console . log (
537- `\n${ colors . YELLOW } === Running Tool-Related Tests ===${ colors . NC } ` ,
538- ) ;
539-
540- // Test 12: CLI mode with tool call
541- await runBasicTest (
542- "tool_call" ,
543- TEST_CMD ,
544- ...TEST_ARGS ,
545- "--cli" ,
546- "--method" ,
547- "tools/call" ,
548- "--tool-name" ,
549- "echo" ,
550- "--tool-arg" ,
551- "message=Hello" ,
552- ) ;
553-
554- // Test 13: CLI mode with tool call but missing tool name (should fail)
555- await runErrorTest (
556- "missing_tool_name" ,
557- TEST_CMD ,
558- ...TEST_ARGS ,
559- "--cli" ,
560- "--method" ,
561- "tools/call" ,
562- "--tool-arg" ,
563- "message=Hello" ,
564- ) ;
565-
566- // Test 14: CLI mode with tool call but invalid tool args format (should fail)
567- await runErrorTest (
568- "invalid_tool_args" ,
569- TEST_CMD ,
570- ...TEST_ARGS ,
571- "--cli" ,
572- "--method" ,
573- "tools/call" ,
574- "--tool-name" ,
575- "echo" ,
576- "--tool-arg" ,
577- "invalid_format" ,
578- ) ;
579-
580- // Test 15: CLI mode with multiple tool args
581- await runBasicTest (
582- "multiple_tool_args" ,
583- TEST_CMD ,
584- ...TEST_ARGS ,
585- "--cli" ,
586- "--method" ,
587- "tools/call" ,
588- "--tool-name" ,
589- "add" ,
590- "--tool-arg" ,
591- "a=1" ,
592- "b=2" ,
593- ) ;
594-
595533 console . log (
596534 `\n${ colors . YELLOW } === Running Resource-Related Tests ===${ colors . NC } ` ,
597535 ) ;
You can’t perform that action at this time.
0 commit comments