ToolCallMiddleware
Agent Runtimes / types/middleware / ToolCallMiddleware
Interface: ToolCallMiddleware
Defined in: types/middleware.ts:80
Middleware for intercepting tool calls
Properties
name
name:
string
Defined in: types/middleware.ts:81
onToolCall
onToolCall: (
options) =>Promise<{overrideResult?:ToolExecutionResult<unknown>;proceed:boolean;reason?:string;toolCall:ToolCallRequest; }>
Defined in: types/middleware.ts:87
Called before a tool is executed Can modify args, approve/reject, or skip execution
Parameters
options
context
toolCall
Returns
Promise<{ overrideResult?: ToolExecutionResult<unknown>; proceed: boolean; reason?: string; toolCall: ToolCallRequest; }>
onToolResult?
optionalonToolResult?: (options) =>Promise<{result:ToolExecutionResult; }>
Defined in: types/middleware.ts:103
Called after a tool is executed (optional)
Parameters
options
context
result
toolCall
Returns
Promise<{ result: ToolExecutionResult; }>