-
Notifications
You must be signed in to change notification settings - Fork 97
feat: Add output schema support to MCP tools #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add output schema support to MCP tools #153
Conversation
|
Hi @chr-hertel, & @CodeWithKyrian the OutputSchema support PR is back up |
ec01d9a to
a2d7b6d
Compare
9234613 to
b3b69cd
Compare
|
Hi @chr-hertel, @Nyholm can I get some eyes on here for the output schema support. Ty |
|
Interesting. I do like the idea. I'll spend some more time to read the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks pretty good already, just one thing i noticed with one test scenario. structuredContent should be optional in response payload
| "isError": false, | ||
| "structuredContent": { | ||
| "result": "System status: OK (discovered)" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder a bit about this change here - it's not adding value to me. spec is unclear about it, but i think we shouldn't just add it always.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chr-hertel this has now been actioned, so structrued content will only be added if outputschema is present and explicility specified
|
@chr-hertel To make |
e8de647 to
329533b
Compare
|
The case that i was pointing out was mostly just returning a string, but still had that |
c8f19cc to
2772869
Compare
4e96598 to
13d5b77
Compare
Good shout ! I was working with the wrong assumption that the result wrapper was in the spec. |
The changes add comprehensive support for outputSchema in the Tools definition, enabling MCP servers to specify the expected structure and types of tool responses.
This includes:
Added outputSchema parameter to Builder::addTool() method
Updated the Tool class constructor and JSON serialization to support outputSchema
Added validation for outputSchema structure and type requirements
Enhanced existing tests to verify outputSchema functionality works correctly
Fixed related type annotation issues and code style problems
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context