Interface: IToolRegistryConfig
Defined in: internal/tool-registry/types.ts:29
Configuration of the ToolRegistry. Lands in IAIGatewayConfig.toolRegistry.
Properties
maxOutputChars?
optionalmaxOutputChars?:number
Defined in: internal/tool-registry/types.ts:35
Largest output a tool may return, measured as JSON text; a larger one fails with a 413; a tool's own maxOutputChars wins (D60). Default 50_000.
onToolError?
optionalonToolError?:TOnToolErrorHandler
Defined in: internal/tool-registry/types.ts:49
The developer's channel for failed tool calls: the tool threw, timed out, returned too much, got an input its schema rejected, or was not offered to the run.
One place to log, count or alert on tool failures, instead of a callback on every tool.
Called for every failed call, fire-and-forget: the run never waits for it, and a handler that throws is logged and
ignored. With or without a handler, every failure is logged on the server, and the model reads only the safe text
(IToolErrorReport.modelText). A 400 (the model's input missed the schema) says the tool's description or schema is
unclear to the model; a 504 that the tool's timeout is short for what it does.
Example
report => logger.warn({tool: report.toolName, code: (report.error as {code?: number}).code, callId: report.callId}) - one log line per failure, findable by the call id in the thread
tools?
optionaltools?:IToolDef<unknown,unknown>[]
Defined in: internal/tool-registry/types.ts:31
Every tool of the gateway, fixed at construction; nothing is added or removed later (D48).
toolTimeoutMs?
optionaltoolTimeoutMs?:number
Defined in: internal/tool-registry/types.ts:33
Time a tool may take before it fails with a 504; a tool's own timeoutMs wins (D60). Default 30_000.