Skip to content

fix: use flat MCP arguments in tool usage examples - #303

Open
syf2211 wants to merge 1 commit into
firecrawl:mainfrom
syf2211:fix/mcp-tool-usage-examples-flat-args
Open

fix: use flat MCP arguments in tool usage examples#303
syf2211 wants to merge 1 commit into
firecrawl:mainfrom
syf2211:fix/mcp-tool-usage-examples-flat-args

Conversation

@syf2211

@syf2211 syf2211 commented Jul 3, 2026

Copy link
Copy Markdown

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/list descriptions and imitate the envelope shape when calling tools. MCP expects flat arguments, so those calls fail parameter validation with errors like query: expected string, received undefined.

Changes

  • Flattened all usage-example JSON blocks in src/index.ts (20 examples) and src/monitor.ts (11 examples)
  • Preserved nested "name" fields inside JSON-schema examples (schema properties, not call wrappers)

Tests

npm run build

Build succeeded locally.

Notes

README and src/legacy/index.md still contain the old envelope format for human docs; they are not served via MCP tools/list. Happy to sync those in a follow-up if desired.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP tool descriptions teach models the wrong calling convention, causing systematic tool-call failures

1 participant