Open
Description
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/:
To Reproduce
- Make a tool with an output schema that has
type: array
- MCP inspector does not work with
tools/list
Expected behavior
Per the spec, any JSON Schema would be supported.