Skip to content

Tools

Tools are user-defined functions that agents can invoke during conversations.

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
  1. Navigate to Tools in the Console
  2. Click New Tool
  3. Define the input schema
  4. Write the tool code
  5. Configure the approval policy

Control when human review is required:

PolicyDescription
auto-approveTool executes without human review
owner-onlyOnly the owner can approve
any-memberAny channel member can approve
self-approvalRequester can approve their own calls

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
// 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,
}

Tools have access to:

  • params - The input parameters passed by the agent
  • context.resources - Connected external resources (databases, APIs)