Skip to content

Calling a tool with structured output that returns an array of objects throws an errorΒ #872

@pnedkovp

Description

@pnedkovp

Inspector Version

  • v0.17

Describe the bug
I am using the cli option to get a tool result of a tool with structured output that returns an array of objects. But instead of getting the result I get the following error:

Failed to call tool get_sessions: [
{
"code": "invalid_type",
"expected": "object",
"received": "array",
"path": [
"structuredContent"
],
"message": "Expected object, received array"
}
]

Failed with exit code: 1

To Reproduce
Steps to reproduce the behavior:

  1. Call a tool using the cli option eg
    npx @modelcontextprotocol/inspector --cli http://localhost:8868/mcp --transport http --method tools/call --tool-name get_sessions

Expected behavior
The tool result should be displayed.

Environment (please complete the following information):

  • OS: OSX
  • Terminal

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliIssues and PRs specific to cli modep1-highHigh priority - should be addressed soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions