?
TaskToolConfig
TypeOne tool for a task agent: an SDK action, an app method, or an inline function.
Each entry in a task's tools array takes one of four shapes: a bare string for an SDK action; { method, defaults } for an SDK action with fields pinned so the model cannot override them; { appMethod, description } to expose one of the app's own methods, run as the invoking user with their roles; or { name, description, inputSchema, execute } for an inline function that runs in the calling method. The app-method and inline-function shapes are what make a task agent part of the app rather than a separate bot. A method used as a tool cannot itself start another task agent.
TaskToolConfig.ts
type TaskToolConfig = | string // SDK action name | { method: string; defaults?: object } // SDK action + pinned defaults | { appMethod: string; description?: string; defaults?: object } | { name: string; description: string; inputSchema?: JsonObjectSchema; execute: (input) => unknown }
Fields
string
SDK action
An SDK action name like 'searchGoogle'. The model receives its full input schema.
{ method, defaults }
SDK action + defaults
An SDK action with default input fields that override the model's arguments for those fields (defaults win, nested included).
{ appMethod, description, defaults }
app method
One of the app's own methods, run as the invoking user with their roles. The task-specific description tells the model when to use it.
{ name, description, inputSchema, execute }
inline function
A function defined at the call site, run in your process. A thrown error is fed back to the model to work around, never failing the task.
The four shapes
tools: [ 'searchGoogle', { method: 'generateImage', defaults: { imageModelOverride: { model: 'seedream-4.5' } } }, { appMethod: 'updateVendor', description: 'Write researched details back. One call per vendor.' }, { name: 'checkExisting', description: 'Look up whether we already track this name.', inputSchema: { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] }, execute: async (i) => Vendors.findByName(String(i.name)) }, ]