Skip to content

Sub-agents API

UClaw agents can spawn other agents to solve sub-tasks. Spawning is facilitated by the built-in ask_agent tool.

Spawning Tool: ask_agent

The runtime registers the sub-agent spawning tool dynamically:

typescript
ask_agent: tool({
  description: "Spawn a helper agent to work on a sub-task independently.",
  displayName: "Helper Agent",
  inputSchema: z.object({
    task: z.string().describe("A clear description of the sub-task to perform."),
  }),
});

When called, a new child Agent instance is created under the same user application.