Skip to content

Bug in example servers (toolResult confusion) #151

@Madd0g

Description

@Madd0g

Describe the bug
A clear and concise description of what the bug is.

it seems like a couple of servers are returning content within toolResult.

Visible in this search (puppeteer/google maps): https://github.com/search?q=repo%3Amodelcontextprotocol%2Fservers%20toolResult&type=code

From the MCP client typescript completions, I see that content should be NEXT TO toolResult, not inside it.

Expected behavior
It makes sense to me that content is the "chat response" and toolResult is arbitrary data that the tool returns, so content should never be inside the result. Please tell me if this is a wrong assumption (since we have no examples of full featured clients).

Additional context
I am playing with the client and trying to understand inputs/outputs, vscode with zod make it really hard to see what's happening.

Since I played with created my own MCP, I can see why the bug can easily happen, this is what I get as autocomplete:

server.setRequestHandler(CallToolRequestSchema, async (request) => {

return {
// autocomplete list I get in vscode (all of these are `unknown`):
capabilities
completion
content
contents
messages
prompts
protocolVersion
resources
resourceTemplates
serverInfo
then
tools
_meta
description
isError
}
  1. It seems to be like a bunch of these don't belong here
  2. No toolResult as an option at all
  3. Nothing has a type

From the client side, I just see these from callTool { content, isError, toolResult, _meta }

Thanks! MCP is cool!

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