SubagentToolSpec
Defined in: agents/src/subagents.ts:90
Properties
Section titled “Properties”agent: | Agent<unknown> | "self";Defined in: agents/src/subagents.ts:94
Host-owned provider, instructions, tools, limits, guards and output contract.
defaultTools?
Section titled “defaultTools?”optional defaultTools?: "none" | "all";Defined in: agents/src/subagents.ts:96
description
Section titled “description”description: string;Defined in: agents/src/subagents.ts:92
followUp?
Section titled “followUp?”optional followUp?: boolean;Defined in: agents/src/subagents.ts:100
Continue completed helpers owned by this creator/tool. Requires host.beforeTool.
optional fork?: SubagentForkPolicy;Defined in: agents/src/subagents.ts:98
Omitted means task-only. Forks require host.beforeTool as a live authority check.
maxLevels?
Section titled “maxLevels?”optional maxLevels?: number;Defined in: agents/src/subagents.ts:102
Explicit recursive spawning permission. Default 1; tree depth still applies.
maxPerCall?
Section titled “maxPerCall?”optional maxPerCall?: number;Defined in: agents/src/subagents.ts:103
maxPerRun?
Section titled “maxPerRun?”optional maxPerRun?: number;Defined in: agents/src/subagents.ts:104
models?
Section titled “models?”optional models?: Readonly<Record<string, ModelChoice>>;Defined in: agents/src/subagents.ts:95
name: string;Defined in: agents/src/subagents.ts:91
needsApproval?
Section titled “needsApproval?”optional needsApproval?: boolean;Defined in: agents/src/subagents.ts:105
prepare?
Section titled “prepare?”optional prepare?: (draft, context) => | SubagentDraft | { refuse: string;} | Promise< | SubagentDraft | { refuse: string;}>;Defined in: agents/src/subagents.ts:108
Pure admission policy. May narrow tools and limits, rewrite instructions/task or refuse. It runs before admission and is not called again for a saved child.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
draft |
SubagentDraft |
context |
SubagentContext |
Returns
Section titled “Returns”| SubagentDraft
| {
refuse: string;
}
| Promise<
| SubagentDraft
| {
refuse: string;
}>
summarize?
Section titled “summarize?”optional summarize?: (results) => string;Defined in: agents/src/subagents.ts:113
Pure. The default is JSON in declaration order.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
results |
readonly SubagentResult<unknown>[] |
Returns
Section titled “Returns”string