bodhi-realtime-agent / ToolDefinition
Interface: ToolDefinition
Defined in: types/tool.ts:17
Declares a tool that Gemini can invoke during a voice session. The framework converts the Zod schema to a Gemini function declaration, validates arguments at runtime, and routes execution based on the execution mode.
Properties
description
description:
string
Defined in: types/tool.ts:21
Description shown to the model to guide tool selection.
execution
execution:
ToolExecution
Defined in: types/tool.ts:25
Whether this tool runs inline (blocking) or in the background (non-blocking).
name
name:
string
Defined in: types/tool.ts:19
Unique tool name (must match across declaration and execution).
parameters
parameters:
ZodType
Defined in: types/tool.ts:23
Zod schema used for both Gemini declaration and runtime argument validation.
pendingMessage?
optionalpendingMessage:string
Defined in: types/tool.ts:27
For background tools: message sent to Gemini immediately so it can acknowledge the request.
timeout?
optionaltimeout:number
Defined in: types/tool.ts:29
Execution timeout in milliseconds (default 30 000).
Methods
execute()
execute(
args,ctx):Promise<unknown>
Defined in: types/tool.ts:31
Execute the tool with validated arguments and an abort-aware context.
Parameters
args
Record<string, unknown>
ctx
Returns
Promise<unknown>