GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — ToolOptions | ADK for TypeScript: API Reference - v2.5.0

  • ToolOptions

Type Alias ToolOptions<TParameters>

The configuration options for creating a function-based tool.

What the model is shown about the tool is built from these options: name, description and the parameters schema become its function declaration. TypeScript types and JSDoc are erased at runtime and cannot be read back, so description is required and per-argument descriptions have to live in the schema — typically as Zod .describe() calls.

new FunctionTool({
name: 'get_weather',
description: 'Returns the current weather for a city.',
parameters: z.object({
city: z.string().describe('City name, e.g. "San Francisco".'),
}),
execute: async ({city}) => fetchWeather(city),
});

A subclass may add to the declaration it derives from these options: given the identical options, LongRunningFunctionTool appends a sentence to description telling the model not to re-invoke a call that is still in flight.

parameters is a description for the model, and only a Zod object schema is additionally enforced at call time — see FunctionTool.runAsync.

type ToolOptions<TParameters extends ToolInputParameters> = {
    description: string;
    execute: ToolExecuteFunction<TParameters>;
    isLongRunning?: boolean;
    name?: string;
    parameters?: TParameters;
    requireConfirmation?: RequireConfirmation<TParameters>;
    response?: SchemaLike;
}

Type Parameters

  • TParameters extends ToolInputParameters
  • Defined in core/src/tools/function_tool.ts:90

Properties

description

description: string
  • Defined in core/src/tools/function_tool.ts:92

execute

execute: ToolExecuteFunction<TParameters>
  • Defined in core/src/tools/function_tool.ts:96

OptionalisLongRunning

isLongRunning?: boolean
  • Defined in core/src/tools/function_tool.ts:97

Optionalname

name?: string
  • Defined in core/src/tools/function_tool.ts:91

Optionalparameters

parameters?: TParameters
  • Defined in core/src/tools/function_tool.ts:93

OptionalrequireConfirmation

requireConfirmation?: RequireConfirmation<TParameters>

Whether this tool requires user confirmation before it runs. A boolean, or a predicate over the (validated) call arguments and tool context returning a boolean.

The HITL gate is enforced when the tool is invoked through an LlmAgent turn: agents/functions.ts surfaces an adk_request_confirmation interrupt from the tool's requestedToolConfirmations, and the tool only executes once the user approves (via the RequestConfirmationLlmRequestProcessor).

NOTE: a workflow ToolNode does not yet route through that path, so a requireConfirmation tool used directly as a node does not pause — it returns the "requires confirmation" error as its node output. Approval for workflow nodes is not wired up. Mirrors Python's FunctionTool(require_confirmation=...).

  • Defined in core/src/tools/function_tool.ts:115

Optionalresponse

response?: SchemaLike

Optional schema describing the tool's return value.

  • Defined in core/src/tools/function_tool.ts:95
Properties
descriptionexecuteisLongRunningnameparametersrequireConfirmationresponse
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.