Repository navigation
New Feature Released: Custom Tools for Agents #127
HighnessAtharva
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Custom tools are here. You can now add your existing bash, Python or Node.js scripts as tools your agent can call.
Open an agent, go to the Tools tab and click Create tool.
Create a Tool
Fill in the dialog:
.sh,.pyor.jsfile up to 64 KiB. The file extension selects the interpreter.Then click Add input for each argument the agent must give your script. Each input has a name, a type, a description and a Required switch. The example above has one required Text input named
city.How a Script Gets Its Input
The agent sends the inputs to the script's stdin as JSON. With no inputs, stdin contains
{}. The script parses the JSON itself.For the
cityinput, the script receives:{ "city": "Mumbai" }Whatever the script prints to stdout becomes the output the agent gets back.
Example Scripts
A bash version of the weather tool:
The Python version in the screenshot above reads stdin with
json.load(sys.stdin)and prints the response.Use the Tool
After you click Create tool, the tool appears in the Custom tools list with its description, script name and input count.
The agent now has the tool in its tool list. Ask for it in chat, for example "Check weather in Mumbai". The agent calls
check_weatherwithcity=Mumbai.Inspect Every Call in Traces
Open Lens, then Traces, to see each tool call. The
check_weatherspan shows the tool arguments and the tool result, so you can confirm what the agent sent and what your script returned.Tell Us What You Think
Reply here with the scripts you turn into tools and anything that blocks you.
Some tenant details in the screenshots are redacted.
All reactions