Skip to main content
In Icepick, a tool is a function that performs a specific task and can be called by agents. Tools handle the actual work while agents orchestrate their execution.

Creating a Tool

To create a tool, define the input and output schemas using Zod. Each Zod field should include a description to improve LLM tool selection when used in a toolbox.
Create the tool using the icepick.tool method:
Tools can perform side effects like API calls, database operations, or file system access. Unlike agents, tools are designed to do the actual work and can maintain state as needed.

Running a Tool

Tools can be executed directly using several methods. The most common is run, which executes the tool and waits for completion:
For fire-and-forget scenarios, use runNoWait to trigger execution without waiting:
Tools can also be scheduled to run at specific times or on recurring schedules:

Using Tools in Agents

Tools are typically called from within agents using the tool’s run method:
This approach allows agents to orchestrate tool execution while maintaining durability and fault tolerance.