[Doc] Use registered callable names in examples/README.md#7
Open
yuki3738 wants to merge 1 commit into
Open
Conversation
This was referenced Jun 23, 2026
530aae8 to
e45962c
Compare
`examples/README.md` referred to three example components by their Ruby class names, while the server examples register them via class registration without an explicit `tool_name` / `prompt_name`. Their callable names exposed over JSON-RPC are therefore derived to the snake_case form 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`. Breaking Changes: None (documentation only).
e45962c to
23350e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
examples/README.mdreferred to three example components by their Ruby class names, while the server examples register them via class registration without an explicittool_name/prompt_name. Their callable names exposed over JSON-RPC are therefore derived to the snake_case form viaStringUtils.handle_from_class_name(used by bothMCP::Tool#name_valueandMCP::Prompt#name_value).tools/callcURL example for the HTTP server used"name": "ExampleTool", but the registered tool isexample_tool, so it would fail withTool not found: ExampleTool(-32602 Invalid params).ExampleToolandExamplePrompt. The siblingechotool is already listed by its callable name.NotificationTool, while the same section's cURL example already usesnotification_tool.The list and cURL entries now consistently use the callable names (
example_tool,example_prompt,notification_tool).How Has This Been Tested?
Ran
ruby examples/http_server.rblocally and exercised the cURL flow against it (SSE event payloads shown without thedata:prefix):Breaking Changes
None (documentation only).
Types of changes
Checklist