anomalyco / anomalyco/opencode
mcp: tool schemas omit required when additionalProperties is false
@neriousy is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
MCP tools advertised to the model set additionalProperties: false without a required array.
McpCatalog.convertTool copies the server schema and then forces additionalProperties: false. If the server omitted required (common for all-optional objects), the wire schema has properties but no required field. Strict OpenAI-compatible validators reject that with errors like 'required' is required to be supplied and to be an array.
The same shape is used for list_mcp_resources / list_mcp_resource_templates, which have an optional server property, additionalProperties: false, and no required.
read_mcp_resource already sets required: ["server", "uri"].
Plugins
None
OpenCode version
dev (c7134cb)
Steps to reproduce
- Convert an MCP tool whose
inputSchemais{ type: "object", properties: { server: { type: "string" } } }(norequired). - Inspect the schema sent to the model:
additionalProperties: false,requiredmissing. - Send that schema to a strict OA-compat validator (Console Go / Codex).
Screenshot and/or share link
No response
Operating System
Linux
Terminal
n/a (unit-level)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.