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
9
9
client /tsconfig.node.tsbuildinfo
10
10
cli /build
11
11
test-output
12
+ tool-test-output
12
13
# symlinked by `npm run link:sdk`:
13
14
sdk
14
15
client /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
395
395
# Call a specific tool
396
396
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg key=value --tool-arg another=value2
397
397
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
+
398
401
# List available resources
399
402
npx @modelcontextprotocol/inspector --cli node build/index.js --method resources/list
400
403
Original file line number Diff line number Diff line change 17
17
"scripts" : {
18
18
"build" : " tsc" ,
19
19
"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"
21
23
},
22
24
"devDependencies" : {},
23
25
"dependencies" : {
Original file line number Diff line number Diff line change @@ -37,9 +37,6 @@ console.log(`${colors.BLUE}- Environment variables (-e)${colors.NC}`);
37
37
console . log ( `${ colors . BLUE } - Config file (--config)${ colors . NC } ` ) ;
38
38
console . log ( `${ colors . BLUE } - Server selection (--server)${ colors . NC } ` ) ;
39
39
console . log ( `${ colors . BLUE } - Method selection (--method)${ colors . NC } ` ) ;
40
- console . log (
41
- `${ colors . BLUE } - Tool-related options (--tool-name, --tool-arg)${ colors . NC } ` ,
42
- ) ;
43
40
console . log ( `${ colors . BLUE } - Resource-related options (--uri)${ colors . NC } ` ) ;
44
41
console . log (
45
42
`${ colors . BLUE } - Prompt-related options (--prompt-name, --prompt-args)${ colors . NC } ` ,
@@ -533,65 +530,6 @@ async function runTests() {
533
530
"tools/list" ,
534
531
) ;
535
532
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
-
595
533
console . log (
596
534
`\n${ colors . YELLOW } === Running Resource-Related Tests ===${ colors . NC } ` ,
597
535
) ;
You can’t perform that action at this time.
0 commit comments