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

    Class LongRunningFunctionTool<TParameters>

    A FunctionTool for long-running operations whose result is returned asynchronously.

    The framework invokes the user-provided function and delivers the response back to the model once it completes, matched up by the function call's id. The model is also instructed not to re-invoke the tool while a call is already in flight.

    Type Parameters

    Hierarchy (View Summary)

    Constructors

    Properties

    "[BASE_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK base tool class.

    "[FUNCTION_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK function tool class.

    description: string
    isLongRunning: boolean
    name: string

    Accessors

    Methods

    • Whether this call is gated on human approval — the static flag, or the predicate evaluated against the validated arguments.

      Parameters

      • args: Record<string, unknown>

        The arguments the tool would run with.

      • OptionaltoolContext: Context

        The context of the call, when there is one.

      Returns Promise<boolean>

      Whether the call requires confirmation.

    • Invokes the user-defined execute function with the model-provided arguments, after parsing them when parameters is a Zod object schema. Any other parameters value is passed through unchecked.

      Parameters

      Returns Promise<unknown>

      A promise resolving to the function's return value.

      Wrapped as Error in tool '<name>': … when a Zod parameters schema rejects the arguments or execute throws.