-
Notifications
You must be signed in to change notification settings - Fork 47
Add structuredContent to tool callback response #37
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
Add structuredContent to tool callback response #37
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@finleyjchen can you confirm this error happens when you try and use the tool, not when Cursor first connects to the server to list the tools. I'm only seeing this error when I try to use a tool in the Cursor agent, so I just want to make sure I'm testing the right things. |
|
I also might have to wait for #36 to get merged before I can test this. |
|
@jonathanbossenger, that's the case for me. Once tools are available (#36) I get an error that structuredContent is missing when using tools, and this fixes it. |
|
Hey @finleyjchen, @stormrockwell, @jonathanbossenger - I am so terribly sorry, something went wrong with the merge and the authorship/props were lost. We're working to get the commit meta corrected ASAP, so your contributions are correctly recognized. @finleyjchen thank you so much for contributing this fix, and @stormrockwell and @jonathanbossenger thanks both of you for your review and testing 🙇♂️ We'll comment back here once the commit is amended. |
This PR restores the props that got squashed off of the merges from WordPress#36 and WordPress#37 Co-authored-by: finleyjchen <inlorfaze@git.wordpress.org> Co-authored-by: jonathanbossenger <psykro@git.wordpress.org> Co-authored-by: stormrockwell <stormrockwell@git.wordpress.org>
When using the mcp-adapter in Cursor, ran into issues detecting the tool. The error looks like this:
{"error": "MCP error -32600: Tool <name> has an output schema but did not return structured content"}.I was reading here:
https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content
modelcontextprotocol/typescript-sdk#911
and found that Cursor and other IDE's handle their MCP implementation inconsistently. VS Code did not have this error, because it seems to not check for existence of
outputSchemaand expect astructuredContentobject, while Cursor does.Adding
structuredContentto the output fixes it.I have tested this when creating a tool that has no
outputSchema, and it still seems to work just fine. It may need to be improved to check foroutputSchemafirst before includingstructuredContent