Skip to content

outputSchema does not fully support JSON Schema #552

Open
@jpmcb

Description

@jpmcb

Describe the bug

Related to spec 2025-06-18, it seems the outputSchema field on tools is not fully supported and seems to always expect type: object which may not always be the shape of the JSON returned.

From the spec:

outputSchema: Optional JSON Schema defining expected output structure

With a valid JSON schema like so for my simple TODO mcp server:

{
  "type": "array",
  "items": {
    "type": "object",
    "required": [ "id", "userId", "title", "completed" ],
    "properties": {
      "id": {
        "type": "integer"
      },
      "userId": {
        "type": "integer"
      },
      "title": {
        "type": "string"
      },
      "completed": {
        "type": "boolean"
      }
    }
  }
}

I can list tools like so:

$ curl http://localhost:9000/mcp \
      -X POST \
      -H 'accept: application/json, text/event-stream' \
      -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/list"
  }'
{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "tools": [
      {
        "name": "get_todos",
        "description": "Gets all the todos in the todo list.",
        "inputSchema": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "outputSchema": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [ "id", "userId", "title", "completed" ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "userId": {
                "type": "integer"
              },
              "title": {
                "type": "string"
              },
              "completed": {
                "type": "boolean"
              }
            }
          }
        }
      }
    ]
  }
}

But in the inspector I get the following error:

{
  "error": [
    {
      "received": "array",
      "code": "invalid_literal",
      "expected": "object",
      "path": [
        "tools",
        1,
        "outputSchema",
        "type"
      ],
      "message": "Invalid literal value, expected \"object\""
    }
  ]
}

Note: this IS valid JSON schema and is validateable on https://www.jsonschemavalidator.net/:

Image

To Reproduce

  1. Make a tool with an output schema that has type: array
  2. MCP inspector does not work with tools/list

Expected behavior

Per the spec, any JSON Schema would be supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions