Skip to content

docs: fix Tool inputSchema example to produce valid JSON Schema#253

Closed
ZhouYinLong-lab wants to merge 1 commit into
modelcontextprotocol:mainfrom
ZhouYinLong-lab:docs/fix-tool-inputschema-example
Closed

docs: fix Tool inputSchema example to produce valid JSON Schema#253
ZhouYinLong-lab wants to merge 1 commit into
modelcontextprotocol:mainfrom
ZhouYinLong-lab:docs/fix-tool-inputschema-example

Conversation

@ZhouYinLong-lab

Copy link
Copy Markdown

What changed

Fixed the inputSchema in the Tool documentation example to produce a valid JSON Schema.

Why

The previous example was invalid JSON Schema:

  1. Missing the required top-level "type": "object" declaration
  2. Property values used plain string types instead of proper { type, description } objects

Users who copy-pasted the example would get schema validation errors from MCP clients.

Verification

The corrected schema follows the JSON Schema specification for objects with properties, matching the pattern documented in the issue discussion.

Related issue

Fixes #128

The previous example was missing the required 'type' declaration and
used plain strings instead of proper JSON Schema property objects.

Fixes #128
@ZhouYinLong-lab ZhouYinLong-lab closed this by deleting the head repository Jul 9, 2026
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.

Is the README example Tool registration method incorrect?

1 participant