Skip to content

Add defer tool loading to enable Anthropic's "Tool Search" pattern #762

@wolfeidau

Description

@wolfeidau

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

Anthropic has introduced a beta feature where tools can be marked with defer_loading: true. For more information see Anthropic Advanced Tool Use Documentation.

Also a good summary here https://x.com/trq212/status/2011523109871108570

Describe the solution you'd like

This would involve adding a property to the Tool structure.

	// Support for deferred loading
	DeferLoading bool `json:"defer_loading"`

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

I have this working with mark3labs/mcp-go#644 using the environment variable ENABLE_TOOL_SEARCH=true with claude code, you can see mcp loaded on demand, and no MCP tools in context in the screenshot below.

Interested in thoughts on this, happy to make a PR.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalA proposal for an a new API or behavior. See CONTRIBUTING.md.waiting for info

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions