Skip to content

Bring back the concept of "toolResult" (non-chat result) #97

@Madd0g

Description

@Madd0g

Is your feature request related to a problem? Please describe.

I was working on an MCP client using the typescript SDK and saw toolResult as something I could get back from callTool(), but after opening this issue I was informed that toolResult is no longer a thing in the spec.

Describe the solution you'd like

I would like a non-chat-content way for tools to return the tool result, this discussion is sort of touching on the same problem, maybe the LLM doesn't necessarily need the full tool result in the chat - maybe the client can choose to use it differently?

I realize that simply an arbitrary "result" field is not a great solution in a spec and maybe that's why it was dropped, but having only one thing to return to the caller - the "chat history" - is very limiting. if toolResult: any is the temporary solution - I still think it has uses (if only for inspector-like tools).

return {
    toolResult: results, // raw result object
    content: [
        {
            type: 'text',
            text: formattedResults, // formatted as chat-message
        },
    ],
    isError: false,
};

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions