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

    Class FinishTaskTool

    Tool for signaling that a task-mode LlmAgent has completed its task.

    The tool's parameters mirror the agent's outputSchema (or a default single result string). The task-mode wrapper sniffs the finish_task function call and, on a successful function response, promotes the call's arguments to the node's output.

    Ported from google/adk-python agents/llm/task/_finish_task_tool.py::FinishTaskTool.

    Hierarchy (View Summary)

    Constructors

    Properties

    "[BASE_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK base tool class.

    description: string
    isLongRunning: boolean
    name: string
    wrapperKey?: string

    When the output schema is a non-object (primitive/array), the value is wrapped under this key (the GenAI API requires object-typed parameters). undefined for object schemas (the value lives at the top level of args).

    Accessors

    Methods

    • Gets the OpenAPI specification of this tool in the form of a FunctionDeclaration.

      NOTE

      • Required if subclass uses the default implementation of processLlmRequest to add function declaration to LLM request.
      • Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

      Returns FunctionDeclaration

      The FunctionDeclaration of this tool, or undefined if it doesn't need to be added to LlmRequest.config.

    • Whether this tool needs a human to approve args before it runs.

      The gate itself lives in the tool that owns it (see FunctionTool), but the resume path has to ask the same question a turn later, to check that an approval it is about to honour belongs to a tool that gates at all. A tool that never gates returns false here, which is the safe default: an approval naming it is meaningless and gets rejected rather than executed. Mirrors Python's BaseTool.check_require_confirmation.

      Parameters

      • _args: Record<string, unknown>

        The arguments the tool would run with.

      • Optional_toolContext: Context

        The context of the call, when there is one.

      Returns Promise<boolean>

      Whether the call requires confirmation.

    • Extracts the task output from a finish_task call's arguments, applying the wrapper-key unwrapping when the schema is a non-object.

      Parameters

      • args: Record<string, unknown>

      Returns unknown