Skip to content

Failed to fetch tools after games.connect: outputSchema.type validation rejects non-"object" types #63

@cryptiklemur

Description

@cryptiklemur

Environment:

  • GABS v1.0.1 (commit cb70244)
  • Claude Code CLI (Claude Opus 4.6, 1M context)
  • RimWorld GABP mod (110 tools discovered)
  • WSL2 / Windows

What happens:

After games.connect succeeds and discovers 110 tools from the GABP server, Claude Code receives a tools/list_changed notification and attempts to refresh the tool list. This refresh fails with a schema validation error, causing the entire MCP server connection to be dropped. All GABS tools become unavailable.

{
  "error": "Failed to fetch tools: [\n  {\n    \"code\": \"invalid_value\",\n    \"values\": [\n      \"object\"\n    ],\n    \"path\": [\n      \"tools\",\n      0,\n      \"outputSchema\",\n      \"type\"\n    ],\n    \"message\": \"Invalid input: expected \\\"object\\\"\"\n  },\n  {\n    \"code\": \"invalid_value\",\n    \"values\": [\n      \"object\"\n    ],\n    \"path\": [\n      \"tools\",\n      2,\n      \"outputSchema\",\n      \"type\"\n    ],\n    \"message\": \"Invalid input: expected \\\"object\\\"\"\n  },\n  {\n    \"code\": \"invalid_value\",\n    \"values\": [\n      \"object\"\n    ],\n    \"path\": [\n      \"tools\",\n      20,\n      \"outputSchema\",\n      \"type\"\n    ],\n    \"message\": \"Invalid input: expected \\\"object\\\"\"\n  },\n  {\n    \"code\": \"invalid_value\",\n    \"values\": [\n      \"object\"\n    ],\n    \"path\": [\n      \"tools\",\n      36,\n      \"outputSchema\",\n      \"type\"\n    ],\n    \"message\": \"Invalid input: expected \\\"object\\\"\"\n  }\n]",
  "timestamp": "2026-04-02T18:03:57.903Z"
}

Sequence of events from logs:

  1. games.connect called → succeeds in 214ms
  2. tools/list_changed notification received → triggers tool refresh
  3. resources/list_changed notification received → triggers resource refresh
  4. Tool refresh fails: 4 tools (indices 0, 2, 20, 36) have outputSchema with non-"object" type
  5. MCP server connection dropped — all GABS tools become unavailable

Root cause:

4 of the GABP-side tools declare an outputSchema where type is not "object". The MCP spec (or Claude Code's MCP client validation) requires outputSchema.type to be exactly "object". When validation fails on any tool, the entire tool list fetch fails, and the MCP server is disconnected.

This is a weird one, as it worked in a prior session (the same log file shows a successful games.connect + games.call_tool sequence from 2026-04-01T22:48 before the same error appeared at 22:48:16 on a tool refresh).

Possible fixes:

  1. GABP side: Ensure all tool outputSchema declarations use "type": "object" (wrap non-object outputs in an object with a single property)
  2. GABS side: Validate/transform tool schemas before exposing them to the MCP client — coerce non-object outputSchemas into { "type": "object", "properties": { "result": { ... } } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions