Skip to content

Disappearance of ToolFor #538

@slacaze

Description

@slacaze

Hi,

In #517, I mentioned I depend on a workflow where I can override the tool definition.

I suppose I should have been for explicit, and mentioned I was using:

toolDefinition, typeLessHandler := mcp.ToolFor

To make an initialization, and wrapping the handler, and then calling sever.AddTool.

However ToolFor seems to have disappeared, leaving me with no way to get the wrapped Handler. Without it, server.AddTool (as opposed to mcp.AddTool) seems quite hard to use and get right.

Specifically, the case I'm struggling to ensure I can replicate is the case where OutputSchema was inferred to something, but I want to set it to nil.

It was trivial with ToolFor, but I don't think I can anymore, because if I call mcp.AddTool, specify OutputSchema to nil, and pass a Handler whose OutputType is not nil, it will add an inferred OutputSchema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions