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

    Class AgentTool

    A tool that wraps an agent.

    This tool allows an agent to be called as a tool within a larger application. The agent's input schema is used to define the tool's input parameters, and the agent's output is returned as the tool's result.

    The configuration of the agent tool.

    Hierarchy (View Summary)

    Constructors

    Properties

    "[AGENT_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK agent tool class.

    "[BASE_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK base tool class.

    description: string
    isLongRunning: boolean
    name: string

    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.

    • Runs the tool with the given arguments and context.

      NOTE

      • Required if this tool needs to run at the client side.
      • Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

      Parameters

      Returns Promise<unknown>

      A promise that resolves to the tool response.