Recreating Anthropic's Tool Search Tool
Hi,
As our tools balloon in size, we were wondering if theres a good way to recreate Anthropic's Tool Search Tool with Mastra. Blog post: https://www.anthropic.com/engineering/advanced-tool-use
We are limited to using open source models so having a good way to create this search without overloading context would be amazing.
Any guidance would be appreciated. Thanks!
Introducing advanced tool use on the Claude Developer Platform
Claude can now discover, learn, and execute tools dynamically to enable agents that take action in the real world. Hereβs how.
10 Replies
π Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10749
π If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly.
π Thank you for helping us improve Mastra!
Hey @sheerazz, Iβm going to play with an experimental tool search utility soon.
But conceptually you have a tool search tool that has a manifest of all the available tools and their description. The search can do relevance, or text search tool find the appropriate tool from the manifest and then execute it
You should be able to build a lightweight one
Thanks @Abhi Aiyer! I built a tool search tool last night, but im having some trouble dynamically changing the tool list available during an agent's stream in between steps. I'd ideally like to keep the multistep interface if possible, but understand if thats not doable
How does it look?
What ive been thinking is having
And somehow the tool gets added/removed in the agent
ours looks lke so:
what we're having trouble with is intercepting the tool search results and changing the activeTools / tool list on the agent during a stream call in between steps
i have a whacky idea for you
what if you:
mastra.getAgent('name').__setTools({})
Thatll set the active tools for the next step i think
Ill test it out this afternoon and will let you know the results!
sweet, i have cursor building out my idea too so we can see if it works lol
playing around here: https://github.com/mastra-ai/mastra/pull/10758/files
GitHub
Tool search and selection utility by abhiaiyer91 Β· Pull Request #1...
Description
This PR introduces a toolSearch utility to enable agents to dynamically discover and utilize tools from a large library without loading all tool definitions into their context upfront. ...