GeezerVison is showing github.com — MCP servers with outputSchema in tools/list break tool discovery · Issue #21591 · anomalyco/opencode
MCP servers with outputSchema in tools/list break tool discovery #21591
Description
Bug Description
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".
Environment
- opencode version: latest (dev branch)
- MCP SDK: v1.27.1
- OS: any
Activity
added
coreAnything pertaining to core functionality of the application (opencode server stuff) on Apr 9, 2026github-actions commented on Apr 9, 2026
This issue might be a duplicate of existing issues. Please check:
If this is indeed a duplicate, please consider closing this issue and adding any additional context to #21373 instead.
removed
coreAnything pertaining to core functionality of the application (opencode server stuff) on May 3, 2026github-actions commented on 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.
Metadata
Metadata
Development
No branches or pull requestsIssue actions