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

    Class LangchainTool

    Wrapper class that adapts a LangChain tool for use in ADK.

    If the original tool name and description are not suitable, you can override them in the constructor.

    Hierarchy (View Summary)

    "[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.

    "[LANGCHAIN_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK LangchainTool class.

    description: string
    isLongRunning: boolean
    name: string

    The wrapped LangChain tool.

    • 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.