Bug Description
list_mcp_resource_templates throws a schema validation error when called without the optional server parameter.
Error:
Invalid schema for function 'list_mcp_resource_templates': null is not of type "array"
Steps to Reproduce
- Run OpenCode 1.18.4 with any MCP server configured
- Call
list_mcp_resource_templates() without the server argument
- The error above is thrown
Root Cause
The tool schema defines server as an optional string type, but when the parameter is omitted (null), the runtime validator incorrectly expects it to be an array type.
Workarounds (confirmed working)
- Pass the server name explicitly:
list_mcp_resource_templates(server="wiki") — works fine
- Use
list_mcp_resources instead (without "templates" suffix) — works fine
Environment
- OpenCode: 1.18.4
- OS: Linux
- Package: @vegamo/deepcode-cli
Bug Description
list_mcp_resource_templatesthrows a schema validation error when called without the optionalserverparameter.Error:
Invalid schema for function 'list_mcp_resource_templates': null is not of type "array"Steps to Reproduce
list_mcp_resource_templates()without theserverargumentRoot Cause
The tool schema defines
serveras an optionalstringtype, but when the parameter is omitted (null), the runtime validator incorrectly expects it to be anarraytype.Workarounds (confirmed working)
list_mcp_resource_templates(server="wiki")— works finelist_mcp_resourcesinstead (without "templates" suffix) — works fineEnvironment