fix: use flat MCP arguments in tool usage examples - #303
Open
syf2211 wants to merge 1 commit into
Open
Conversation
Tool descriptions served via tools/list showed JSON examples wrapped in
{name, arguments} envelopes. Some models imitated that shape and failed
MCP parameter validation. Examples now match each tool input_schema.
This was referenced Jul 17, 2026
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.
Summary
Fixes #279 by updating MCP tool description "Usage Example" JSON blocks to show flat argument objects that match each tool's
input_schema, instead of the{"name": ..., "arguments": ...}envelope format.Motivation
Some models (especially smaller ones) read usage examples from
tools/listdescriptions and imitate the envelope shape when calling tools. MCP expects flat arguments, so those calls fail parameter validation with errors likequery: expected string, received undefined.Changes
src/index.ts(20 examples) andsrc/monitor.ts(11 examples)"name"fields inside JSON-schema examples (schema properties, not call wrappers)Tests
Build succeeded locally.
Notes
README and
src/legacy/index.mdstill contain the old envelope format for human docs; they are not served via MCPtools/list. Happy to sync those in a follow-up if desired.