Tools
Tools are user-defined functions that agents can invoke during conversations.
Overview
Section titled “Overview”Each tool has:
- Name and description - How the agent identifies the tool
- Input schema - JSON Schema defining expected parameters
- Code - JavaScript executed in a secure sandbox
- Approval policy - When human review is required
Creating a Tool
Section titled “Creating a Tool”- Navigate to Tools in the Console
- Click New Tool
- Define the input schema
- Write the tool code
- Configure the approval policy
Approval Policies
Section titled “Approval Policies”Control when human review is required:
| Policy | Description |
|---|---|
auto-approve | Tool executes without human review |
owner-only | Only the owner can approve |
any-member | Any channel member can approve |
self-approval | Requester can approve their own calls |
Secure Execution
Section titled “Secure Execution”Tool code runs in an isolated sandbox with:
- Memory limits
- CPU time limits (configurable, 100ms to 60s)
- Network isolation
- No access to the host filesystem
Example Tool
Section titled “Example Tool”// Input: { customerId: string }const { customerId } = params
const customer = await context.resources.stripe.request("GET", `/v1/customers/${customerId}`)const subscriptions = await context.resources.stripe.request( "GET", `/v1/subscriptions?customer=${customerId}&status=active`,)
return { customer: customer.email, plan: subscriptions.data[0]?.items.data[0]?.price.nickname, status: subscriptions.data[0]?.status,}Tool Context
Section titled “Tool Context”Tools have access to:
params- The input parameters passed by the agentcontext.resources- Connected external resources (databases, APIs)