Skip to content

Commit dae3890

Browse files
committed
Change --tool-args to --tool-arg for consistency
1 parent f4e6f4d commit dae3890

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed

README.md

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ npx @modelcontextprotocol/inspector --cli --config path/to/config.json --server
8989
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list
9090

9191
# Call a specific tool
92-
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-args key=value --tool-args another=value2
92+
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg key=value --tool-arg another=value2
9393

9494
# List available resources
9595
npx @modelcontextprotocol/inspector --cli node build/index.js --method resources/list
@@ -101,38 +101,8 @@ npx @modelcontextprotocol/inspector --cli node build/index.js --method prompts/l
101101
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com
102102

103103
# Call a tool on a remote server
104-
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method tools/call --tool-name remotetool --tool-args param=value
104+
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method tools/call --tool-name remotetool --tool-arg param=value
105105

106106
# List resources from a remote server
107107
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method resources/list
108-
```
109-
110-
For more details on ways to use the inspector, see the [Inspector section of the MCP docs site](https://modelcontextprotocol.io/docs/tools/inspector). For help with debugging, see the [Debugging guide](https://modelcontextprotocol.io/docs/tools/debugging).
111-
112-
### From this repository
113-
114-
If you're working on the inspector itself:
115-
116-
Development mode:
117-
118-
```bash
119-
npm run dev
120-
```
121-
122-
> **Note for Windows users:**
123-
> On Windows, use the following command instead:
124-
>
125-
> ```bash
126-
> npm run dev:windows
127-
> ```
128-
129-
Production mode:
130-
131-
```bash
132-
npm run build
133-
npm start
134-
```
135-
136-
## License
137-
138-
This project is licensed under the MIT License—see the [LICENSE](LICENSE) file for details.
108+
```

bin/tests/cli-tests.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo -e "${BLUE}- Environment variables (-e)${NC}"
2121
echo -e "${BLUE}- Config file (--config)${NC}"
2222
echo -e "${BLUE}- Server selection (--server)${NC}"
2323
echo -e "${BLUE}- Method selection (--method)${NC}"
24-
echo -e "${BLUE}- Tool-related options (--tool-name, --tool-args)${NC}"
24+
echo -e "${BLUE}- Tool-related options (--tool-name, --tool-arg)${NC}"
2525
echo -e "${BLUE}- Resource-related options (--uri)${NC}"
2626
echo -e "${BLUE}- Prompt-related options (--prompt-name, --prompt-args)${NC}"
2727
echo -e "${BLUE}- Logging options (--log-level)${NC}"
@@ -171,16 +171,16 @@ run_error_test "nonexistent_server" "--config" "$PROJECT_ROOT/sample-config.json
171171
echo -e "\n${YELLOW}=== Running Tool-Related Tests ===${NC}"
172172

173173
# Test 12: CLI mode with tool call
174-
run_basic_test "tool_call" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-name" "echo" "--tool-args" "message=Hello"
174+
run_basic_test "tool_call" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-name" "echo" "--tool-arg" "message=Hello"
175175

176176
# Test 13: CLI mode with tool call but missing tool name (should fail)
177-
run_error_test "missing_tool_name" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-args" "message=Hello"
177+
run_error_test "missing_tool_name" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-arg" "message=Hello"
178178

179179
# Test 14: CLI mode with tool call but invalid tool args format (should fail)
180-
run_error_test "invalid_tool_args" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-name" "echo" "--tool-args" "invalid_format"
180+
run_error_test "invalid_tool_args" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-name" "echo" "--tool-arg" "invalid_format"
181181

182182
# Test 15: CLI mode with multiple tool args
183-
run_basic_test "multiple_tool_args" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-name" "add" "--tool-args" "a=1" "b=2"
183+
run_basic_test "multiple_tool_args" "${TEST_CMD}" "${TEST_ARGS[@]}" "--cli" "--method" "tools/call" "--tool-name" "add" "--tool-arg" "a=1" "b=2"
184184

185185
echo -e "\n${YELLOW}=== Running Resource-Related Tests ===${NC}"
186186

@@ -218,7 +218,7 @@ echo -e "${BLUE}Testing combined options with environment variables and config f
218218
run_basic_test "combined_options" "--config" "$PROJECT_ROOT/sample-config.json" "--server" "everything" "-e" "CLI_ENV_VAR=cli_value" "--cli" "--method" "tools/list"
219219

220220
# Test 24: CLI mode with all possible options (that make sense together)
221-
run_basic_test "all_options" "--config" "$PROJECT_ROOT/sample-config.json" "--server" "everything" "-e" "CLI_ENV_VAR=cli_value" "--cli" "--method" "tools/call" "--tool-name" "echo" "--tool-args" "message=Hello" "--log-level" "debug"
221+
run_basic_test "all_options" "--config" "$PROJECT_ROOT/sample-config.json" "--server" "everything" "-e" "CLI_ENV_VAR=cli_value" "--cli" "--method" "tools/call" "--tool-name" "echo" "--tool-arg" "message=Hello" "--log-level" "debug"
222222

223223
# Print test summary
224224
echo -e "\n${YELLOW}=== Test Summary ===${NC}"

cli/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Args = {
2828
uri?: string;
2929
logLevel?: LogLevel;
3030
toolName?: string;
31-
toolArgs?: Record<string, string>;
31+
toolArg?: Record<string, string>;
3232
};
3333

3434
function createTransportOptions(target: string[]): TransportOptions {
@@ -81,7 +81,7 @@ async function callMethod(args: Args): Promise<void> {
8181
);
8282
}
8383

84-
result = await callTool(client, args.toolName, args.toolArgs || {});
84+
result = await callTool(client, args.toolName, args.toolArg || {});
8585
}
8686
// Resources methods
8787
else if (args.method === "resources/list") {
@@ -177,8 +177,8 @@ function parseArgs(): Args {
177177
//
178178
.option("--tool-name <toolName>", "Tool name (for tools/call method)")
179179
.option(
180-
"--tool-args <pairs...>",
181-
"Tool arguments as key=value pairs",
180+
"--tool-arg <pairs...>",
181+
"Tool argument as key=value pair",
182182
parseKeyValuePair,
183183
{},
184184
)

0 commit comments

Comments
 (0)