ADK for TypeScript: API Reference
    Preparing search index...

    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>;
    }

    Type Parameters

    Properties

    description: string
    isLongRunning?: boolean
    name?: string
    parameters?: TParameters
    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=...).