OutputSchema support in MCP tools#654
OutputSchema support in MCP tools#654bzsurbhi wants to merge 6 commits intomodelcontextprotocol:mainfrom
Conversation
src/mcp/types.py
Outdated
| model_config = ConfigDict(extra="allow") | ||
|
|
||
|
|
||
| class DataContent(BaseModel): |
There was a problem hiding this comment.
Slightly confused didn't modelcontextprotocol/modelcontextprotocol#356 get paused awaiting more evidence extra complexity is worth while.
There was a problem hiding this comment.
You're right. I updated the PR as per the new schema
|
Looks like I missed this merge request, I'm happy for maintainers to cherry pick from #685 the bits you want to keep, if you want any help in cherry picking let me know |
|
Apologies for the time it took to get to this and thank you for your contribution. I believe this would have already been implemented as part of #1005 which adds structured output support. I'm therefore closing this PR but do feel free to re-open if there's a misunderstanding or you were intending to implement something different! |
Add outputSchema support to MCP tools
Motivation and Context
Implemented changes in PR for outputSchema
Key implementation details:
outputSchemafield to theToolclass to store the JSON schema for tool outputsfunc_metadatato extract return type annotations and generate JSON schemasHow Has This Been Tested?
Added tests with tools using various return types including:
Breaking Changes
No breaking changes. The outputSchema is optional and backward compatible with existing tools.
Types of changes
Checklist
Additional context