AgentTool
Spawns an independent sub-agent to handle a task autonomously. The sub-agent runs with its own context, tool access, and (optionally) its own working directory or isolated git worktree. The calling agent waits for the sub-agent to complete and receives its output.Parameters
A short (3–5 word) description of the task. Used in the UI and for logging.
Detailed instructions for the sub-agent. Be explicit about what the agent should do, what files or directories to work in, and what output is expected.
The name of a specialized agent definition to use. If omitted, a general-purpose agent is spawned.
Optional model override:
"sonnet", "opus", or "haiku". Overrides the agent definition’s configured model. If omitted, the agent inherits the parent’s model.When
true, the sub-agent runs asynchronously and the parent agent continues immediately. The parent is notified when the background agent completes.Isolation mode for the sub-agent:
"worktree"— creates a temporary git worktree so the agent works on an isolated copy of the repository
Absolute path to use as the working directory for the sub-agent. Overrides all filesystem and shell operations within the agent. Mutually exclusive with
isolation: "worktree".A name for the spawned agent. Makes the agent addressable via SendMessageTool while it is running.
Returns
The sub-agent’s final output as a string when it completes successfully.Example
Spawning an agent to write tests for a module:Sub-agents have access to the same built-in tools as the parent agent. They do not share conversation history with the parent—each sub-agent starts with a fresh context and the instructions in
prompt.Task management tools
Background tasks are long-running agent operations that continue independently while the main session proceeds. These tools let you create, monitor, update, and stop background tasks.TaskCreateTool
TaskCreateTool
Creates a background task that runs asynchronously. The task is identified by a name you provide.Parameters
name(string, required) — a unique identifier for the taskprompt(string, required) — instructions for the task agent
TaskListTool
TaskListTool
Lists all active and recently completed background tasks in the current session, including their names, IDs, and current status.Parameters — none required.Returns an array of task summaries.
TaskGetTool
TaskGetTool
Retrieves the current output and status of a specific background task.Parameters
task_id(string, required) — the ID of the task to query
TaskUpdateTool
TaskUpdateTool
Sends updated instructions to a running background task, allowing you to redirect or refine what it is working on.Parameters
task_id(string, required) — the ID of the task to updateprompt(string, required) — updated instructions for the task
TaskStopTool
TaskStopTool
Stops a running background task.Parameters
task_id(string, required) — the ID of the task to stop
TaskOutputTool
TaskOutputTool
Streams or retrieves the output from a background task.Parameters
task_id(string, required) — the ID of the task
Team tools
Agent teams are named groups of agents that can be created and disbanded as a unit.TeamCreateTool
TeamCreateTool
Creates a named team and spawns the agents that make it up. Agents in a team can address each other by name using SendMessageTool.Parameters
team_name(string, required) — a unique name for the teamagents(array, required) — definitions of each agent in the team, including their names, roles, and prompts
TeamDeleteTool
TeamDeleteTool
Disbands an agent team, stopping all agents that are still running as part of it.Parameters
team_name(string, required) — the name of the team to disband
SendMessageTool
Sends a message to another agent’s mailbox. Used for coordination between concurrently running agents.Parameters
The target agent’s identifier or name (as set when spawning the agent with AgentTool’s
name parameter).The message content to deliver to the target agent.