Skip to content

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

Closed
chr-hertel wants to merge 1 commit into
mainfrom
fix/issue-25-injectable-schema-leak
Closed

chr-hertel wants to merge 1 commit into
mainfrom
fix/issue-25-injectable-schema-leak

Conversation

@chr-hertel

Copy link
Copy Markdown
Owner

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.

Closes #25. Also fixes the injectable-drift half of #13 (the metadata-factory half stays open).

Confidence: 9/10 — minimal verbatim-moved logic, new tests fail without the fix, full unit+integration suites, cs-fixer and phpstan green.

@chr-hertel

Copy link
Copy Markdown
Owner Author

Merged upstream with modelcontextprotocol#482

@chr-hertel chr-hertel closed this Aug 24, 2026
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C2] ClientGateway parameters leak into the published inputSchema

1 participant