Commit e525b7b
committed
[Doc] Use registered callable names in examples/README.md
`examples/README.md` referred to three example components by their Ruby class names, while the server examples register them by passing the class itself, without setting an explicit `tool_name` / `prompt_name`. Their callable names exposed over JSON-RPC are therefore the snake_case form of the class name, derived via `StringUtils.handle_from_class_name` (used by both `MCP::Tool#name_value` and `MCP::Prompt#name_value`).
- The `tools/call` cURL example for the HTTP server used `"name": "ExampleTool"`, but the registered tool is `example_tool`, so it would fail with `Tool not found: ExampleTool` (-32602 Invalid params).
- The HTTP Server "Tools" list and "Prompts" list referred to `ExampleTool` and `ExamplePrompt`. The sibling `echo` tool is already listed by its callable name.
- The Streamable HTTP Server "Available Tools" list referred to `NotificationTool`, while the same section's cURL example already uses `notification_tool`.
The list and cURL entries now consistently use the callable names (`example_tool`, `example_prompt`, `notification_tool`).
How Tested: Ran `ruby examples/http_server.rb` and exercised the cURL flow. `tools/list` returned `example_tool` and `echo`; `tools/call` with `"name": "ExampleTool"` returned `Tool not found: ExampleTool`; with `"name": "example_tool"` returned `The sum of 5 and 3 is 8`. `prompts/list` returned `example_prompt`. The full unit suite and RuboCop pass locally.
Breaking Changes: None (documentation only).1 parent b1a31ee commit e525b7b
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
0 commit comments