Skip to content

list_mcp_resource_templates: schema validation error when server param is omitted #250

Description

@ganyu143

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

  1. Run OpenCode 1.18.4 with any MCP server configured
  2. Call list_mcp_resource_templates() without the server argument
  3. 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)

  1. Pass the server name explicitly: list_mcp_resource_templates(server="wiki") — works fine
  2. Use list_mcp_resources instead (without "templates" suffix) — works fine

Environment

  • OpenCode: 1.18.4
  • OS: Linux
  • Package: @vegamo/deepcode-cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions