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
MCP servers with outputSchema in tools/list break tool discovery #21591
When an MCP server returns outputSchema in its tools/list response, opencode shows "Failed to get tools" and the server becomes unusable. The outputSchema field is valid per MCP spec (protocol version 2025-06-18).
Steps to Reproduce
Configure an MCP server that returns tools with outputSchema in the tool definition
Start opencode
Observe "Failed to get tools" for that server
Expected Behavior
Tools should load successfully. opencode doesn't use outputSchema — it only reads inputSchema in convertMcpTool().
Actual Behavior
The entire listTools() call fails because cacheToolMetadata() calls AjvJsonSchemaValidator.getValidator(tool.outputSchema), and if AJV can't compile the schema (unsupported keywords, complex schemas), it throws an unhandled error.
Root Cause
AjvJsonSchemaValidator.getValidator() in the MCP SDK calls ajv.compile(schema) with no try/catch. The error propagates through listTools() → caught by opencode's defs() → returns undefined → "Failed to get tools".
Activity
github-actions commentedon Apr 9, 2026
This issue might be a duplicate of existing issues. Please check:
outputSchemaintools/listresponse causing "Failed to get tools" error, with identical MCP SDK version and protocol version mentioned.If this is indeed a duplicate, please consider closing this issue and adding any additional context to #21373 instead.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.