Skip to content

[Server] Keep injectable parameters out of the published inputSchema - #482

Merged
chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix/issue-25-injectable-schema-leak
Aug 24, 2026
Merged

[Server] Keep injectable parameters out of the published inputSchema#482
chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix/issue-25-injectable-schema-leak

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

A tool handler typed against ClientGateway published a phantom parameter in its inputSchema, and argument validation then rejected every legitimate call: ReferenceHandler::prepareArguments() injected RequestContext and ClientGateway, but SchemaGenerator::parseParametersInfo() only skipped RequestContext.

The injectable set now lives in one place, InjectableParameters, read by both sides — schema generation via supports(), argument preparation via resolve() — so they cannot drift again. Behavior is otherwise unchanged.

Regression tests: schema generation excludes ClientGateway/RequestContext parameters, ReferenceHandler still injects the gateway, and an integration test proves a gateway-typed tool publishes a clean schema and stays callable end to end.

Fork issue: chr-hertel#25. Also fixes the injectable-drift half of chr-hertel#13.

@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Aug 24, 2026
@chr-hertel
chr-hertel merged commit e173367 into modelcontextprotocol:main Aug 24, 2026
51 of 52 checks passed
@chr-hertel
chr-hertel deleted the fix/issue-25-injectable-schema-leak branch August 24, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant