Skip to content

Strict validation fails for optional Tool/Prompt fields (title, icons, outputSchema, annotations) #987

@vavasilva

Description

@vavasilva

Description

MCP Inspector fails with validation errors when connecting to a valid MCP server that doesn't include optional fields in Tool and Prompt definitions.

Error Messages

When clicking on Tools tab:

[
  { "expected": "string", "code": "invalid_type", "path": ["tools", 0, "title"], "message": "Invalid input" },
  { "expected": "array", "code": "invalid_type", "path": ["tools", 0, "icons"], "message": "Invalid input" },
  { "expected": "object", "code": "invalid_type", "path": ["tools", 0, "outputSchema"], "message": "Invalid input" },
  { "expected": "object", "code": "invalid_type", "path": ["tools", 0, "annotations"], "message": "Invalid input" },
  { "expected": "object", "code": "invalid_type", "path": ["tools", 0, "execution"], "message": "Invalid input" }
]

When clicking on Prompts tab:

[
  { "expected": "string", "code": "invalid_type", "path": ["prompts", 0, "title"], "message": "Invalid input" },
  { "expected": "array", "code": "invalid_type", "path": ["prompts", 0, "icons"], "message": "Invalid input" }
]

Expected Behavior

According to the MCP specification, these fields are optional:

  • title (optional string)
  • icons (optional array)
  • outputSchema (optional object)
  • annotations (optional object)
  • execution (optional object)

The Inspector should not fail validation when these optional fields are not present.

Environment

  • MCP Inspector: latest via npx @modelcontextprotocol/inspector
  • Transport: STDIO via mcp-remote
  • MCP Server: Python with mcp>=1.0.0
  • OS: macOS

Steps to Reproduce

  1. Create an MCP server with tools/prompts that only include required fields (name, description, inputSchema)
  2. Connect via Inspector using STDIO transport with mcp-remote
  3. Click on Tools or Prompts tab
  4. See validation errors

Workaround

The server works correctly with Claude Desktop and Claude.ai. Only the Inspector UI shows these validation errors.

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