- 
                Notifications
    You must be signed in to change notification settings 
- Fork 77
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When output schema is described like
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {"type": "string"},
      "nick": {"type": "string"},
    },
    "required": ["name", "nick"]
  }
}
MCP clients will see just ({type: "object}) because of this logic https://github.com/modelcontextprotocol/ruby-sdk/blob/main/lib/mcp/tool/output_schema.rb#L22-L27 (Am I right?).
To Reproduce
Steps to reproduce the behavior:
- Create a new tool like
class TestTool < MCP::Tool
  output_schema({
    description: "A list of things",
    type: "array",
    items: {
      type: "object",
      properties: {
        name: {type: "string"},
        nick: {type: "string"},
      },
      required: ["name", "nick"],
    },
  })
end
- Check tool's information using something like @modelcontextprotocol/inspector
Expected behavior
It is expected that tool can notify client about output schema that is a list of something.
Logs
none
Additional context
I can try to propose a PR... Might not cover all the cases tho. Unless { type: "object" }.tap was used specifically and is not subject to change,
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working