GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — MCP tool wrapper sends mutually exclusive optional parameters · Issue #27527 · anomalyco/opencode Closed DescriptionSummaryOpenCode appears to serialize MCP tool arguments in a way that sends mutually exclusive optional fields together, even when only one mode should be used. This breaks MCP tools whose schemas expose multiple mutually exclusive call modes. I reproduced this on OpenCode Environment
ReproductionUse an MCP tool that exposes two mutually exclusive edit modes:
When attempting full replacement through OpenCode's generated tool wrapper, the tool fails with: When attempting search-and-replace through OpenCode's generated tool wrapper, it also fails with the same error. This suggests OpenCode is sending both Additional ExampleA similar issue occurs with a list/search tool that supports either:
but not both. Calling it through OpenCode fails with: This happens even when no title filter is intended. Control TestCalling the same MCP server directly via raw JSON-RPC works when only the intended fields are sent. For example, this kind of payload succeeds for full replacement: {
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "edit_document",
"arguments": {
"document": "test-document",
"teamspace": "test-space",
"title": "test-document",
"content": "updated content"
}
},
"id": 2
}So the MCP server accepts the call when optional fields are omitted correctly. Expected BehaviorOpenCode should omit optional MCP tool arguments that were not explicitly provided by the model/tool caller. For mutually exclusive parameter groups, absent fields should not be serialized as empty strings or default values. Actual BehaviorOpenCode appears to send all fields declared in the generated tool schema, including fields that should be absent, causing MCP servers to reject otherwise valid calls. ImpactThis breaks MCP tools that use mutually exclusive optional parameters or mode-based arguments. Some tools become unusable through OpenCode even though they work through direct MCP JSON-RPC. Possible WorkaroundA local plugin using Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |