Skip to content

ToolDefinition

A tool that runs in this process, for agents to call.

Type Parameter Default type
Input extends StandardSchemaWithJSON StandardSchemaWithJSON
Property Type Description
name string The tool's name. Agents see it as workers__<name>.
title? string -
description? string What it does, for the model.
input Input Its arguments' schema, such as z.object({ … }).
idempotent? boolean true if running it again with the same idempotency key has no second effect. A call cut off mid-run runs again if every worker offering the tool says so. Otherwise it waits on a person.
readOnly? boolean true if it changes nothing. Other tools wait on a person unless the agent's policy allows them.
run(args, context): unknown;

Runs the tool. Return an object or a string. Throw to fail the call.

Parameter Type
args InferOutput<Input>
context ToolContext

unknown