You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add OutputSchema to Tool and CallToolResult.structuredContent #285
Schema changes to add Tool.outputSchema and CallToolResult.structuredContent
No server side changes since the tool definition and result definition are dependent on the server owner.
Client side changes to create a caching mechanism of sorts for the tool list and leveraging this mechanism to validate the Tool.outputSchema against the CallToolResult.structuredContent when required [According to the spec: Clients SHOULD validate structured results against this schema.]
Relevant tests
My major question about the scope of work revolves around the client side changes. I saw that there was some discussion around a standalone schema validator in #271. Should I introduce the caching mechanism and validator changes in the first PR itself or should that be a PR of its own? I think they can be separated for the first iteration since this is a SHOULD statement. Would like some maintainer input on this to reduce churn.
Hey @loong-coder. I have the changes but based on the contributing guidelines and comments from a maintainer in #271, I need to clarify the scope of work after creating an issue to claim work on the feature. I have tried to that in the comment above yours. If I don't hear back from them in a couple of days, I will raise the PR as is.
Updating the Schema to add Schema changes to add Tool.outputSchema and CallToolResult.structuredContent is obvious.
The specification though says that If an output schema is provided, Servers MUST provide structured results that conform to this schema. IMO this means that the MCP server needs to validate the structured output to ensure it is conformant to the output-schema: https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema.
The client SHOULD (not MUST e.g. optionally) validate the response.
Activity
[-]Add OutputSchema to Tool[/-][+]Add OutputSchema to Tool and CallToolResult.structuredContent[/+]pantanurag555 commentedon Jun 5, 2025
@tzolov @chemicL Hey there, I am picking up work on these changes and wanted to clarify the scope of the work based on the contributing guidelines.
Relevant PRs for python-sdk: #685 #684
Scope:
Clients SHOULD validate structured results against this schema.]My major question about the scope of work revolves around the client side changes. I saw that there was some discussion around a standalone schema validator in #271. Should I introduce the caching mechanism and validator changes in the first PR itself or should that be a PR of its own? I think they can be separated for the first iteration since this is a SHOULD statement. Would like some maintainer input on this to reduce churn.
loong-coder commentedon Jun 6, 2025
Hello @pantanurag555 , could you please provide an update on the #285 ? I'd appreciate knowing its current status.
pantanurag555 commentedon Jun 6, 2025
Hey @loong-coder. I have the changes but based on the contributing guidelines and comments from a maintainer in #271, I need to clarify the scope of work after creating an issue to claim work on the feature. I have tried to that in the comment above yours. If I don't hear back from them in a couple of days, I will raise the PR as is.
pantanurag555 commentedon Jun 9, 2025
Implementation PR: #302
tzolov commentedon Jun 30, 2025
Hi @pantanurag555 , thank you for raising this issue.
Updating the Schema to add Schema changes to add Tool.outputSchema and CallToolResult.structuredContent is obvious.
The specification though says that
If an output schema is provided, Servers MUST provide structured results that conform to this schema. IMO this means that the MCP server needs to validate the structured output to ensure it is conformant to the output-schema:https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema.The client SHOULD (not MUST e.g. optionally) validate the response.
Here is my read of the spec: #357
Also #357 introduces a plugable JsonSchemaValidator abstraction that perhaps can be (re)used for the client side validations (including the #271).
tzolov commentedon Feb 18, 2026
Resolved by #357