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
When a remote MCP server returns structured content that violates its own declared outputSchema, opencode hard-fails the entire tool call. A single mistyped field makes an otherwise-working tool 100% unusable and discards the (valid) content. opencode should degrade gracefully — normalize the value, or surface the raw text plus a warning — instead of treating the mismatch as fatal.
Environment
opencode version: 2.0.29
OS: Darwin 27.0.0 (arm64)
Terminal: Apple Terminal (TERM_PROGRAM=Apple_Terminal, TERM=xterm-256color, COLORTERM=truecolor)
Shell: /bin/zsh
Install/channel: latest
Active plugins: none found (~/.config/opencode/opencode.json defines only an MCP server)
Reproduction
Configure a remote MCP server (example: Robinhood trading, https://agent.robinhood.com/mcp/trading) and authenticate via /mcps.
Call review_advanced_order with any valid arguments, e.g.:
Observe the call fail with a schema-validation error.
Expected Behavior
The tool call succeeds or degrades gracefully. A response whose fields are valid JSON but do not exactly match the declared schema should not be a fatal error. opencode should normalize the value, or return the raw content with a warning, so the tool remains usable.
Actual Behavior
The call fails outright and no content is returned:
MCP tool "review_advanced_order" on server "robinhood" failed: Structured content does not match the tool's output schema: data/data/quote_data/previous_close_date must be null,object
Reproducible consistently — it failed on two consecutive attempts with identical parameters.
Additional Context
Root cause is server-side: review_advanced_order's declared output schema types quote_data.previous_close_date as null | object, but the server returns a string (e.g. "2026-10-14"). Sibling tools on the same server (place_equity_order, review_equity_order, get_equity_quotes) correctly declare the same field as null | string, so the server schema is inconsistent for this one tool.
Impact: because opencode treats the mismatch as fatal, the tool is completely unusable and the otherwise-valid response is discarded. A graceful path would keep users working while the server fixes its schema, since not every third-party server can be patched on the client's timeline.
Thanks for the detailed report and for tracking down the root cause in the server's schema.
To restate the request: when an MCP server returns structured content that doesn't match its own declared outputSchema, opencode should still return the content, with a warning, instead of failing the whole tool call.
Right now this is intended behaviour, not a bug. The MCP SDK client that opencode uses checks structuredContent against the declared output schema and rejects the call when they don't match. That check runs before opencode or any plugin sees the result, so a plugin can't work around it today. Maintainers will consider making this more forgiving, for example by treating a mismatch as a warning or adding a per-server option to turn the check off. I can't promise whether or when that will happen.
Related issues about strict MCP schema handling (they reject schemas when tools are loaded, rather than tool results):
Until then, your workaround of calling place_advanced_order directly is the best option. It may also help to report the previous_close_date schema mismatch to Robinhood.
Activity
opencode-agent commentedon Oct 16, 2026
Thanks for the detailed report and for tracking down the root cause in the server's schema.
To restate the request: when an MCP server returns structured content that doesn't match its own declared
outputSchema, opencode should still return the content, with a warning, instead of failing the whole tool call.Right now this is intended behaviour, not a bug. The MCP SDK client that opencode uses checks
structuredContentagainst the declared output schema and rejects the call when they don't match. That check runs before opencode or any plugin sees the result, so a plugin can't work around it today. Maintainers will consider making this more forgiving, for example by treating a mismatch as a warning or adding a per-server option to turn the check off. I can't promise whether or when that will happen.Related issues about strict MCP schema handling (they reject schemas when tools are loaded, rather than tool results):
Until then, your workaround of calling
place_advanced_orderdirectly is the best option. It may also help to report theprevious_close_dateschema mismatch to Robinhood.rekram1-node commentedon Oct 22, 2026
Your server is in violation of the mcp spec. Not a bug on our end. Maybe we will be more graceful but this should be fixed in your server