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

    Class ToolNode

    A node that wraps an ADK BaseTool and invokes it with the node input as its arguments.

    Ported from google/adk-python workflow/_tool_node.py. The node input is coerced to a tool-args object: genai Content → its text; a JSON string → parsed object; null/empty → {}.

    The tool runs through the canonical execution path (handleFunctionCallList), so the plugin before/after/onError tool callbacks, the confirmation gate, telemetry, and everything the tool writes to its context (stateDelta, artifactDelta, requested credentials / confirmations, …) all apply — exactly as when the same tool is called from an LLM agent. The emitted event carries a canonical functionResponse part.

    Hierarchy (View Summary)

    Constructors

    Properties

    "[BASE_NODE_SIGNATURE_SYMBOL]": true

    Brand identifying this object as a BaseNode (see isBaseNode).

    description: string
    inputSchema?: SchemaLike
    isolationScope?: string | true
    name: string
    outputSchema?: SchemaLike
    preparedRetryConfig?: PreparedRetryConfig

    The retry config with its exception filter normalized once, up front (see prepareRetryConfig). Used by the node runner so the retry hot path never re-normalizes or throws on a malformed config mid-retry.

    rerunOnResume: boolean
    retryConfig?: RetryConfig
    stateSchema?: SchemaLike
    timeout?: number
    tool: BaseTool
    waitForOutput: boolean

    Accessors

    • get requiresAllPredecessors(): boolean

      Whether this node must wait for ALL of its predecessors to trigger before it runs (fan-in barrier). Overridden by JoinNode.

      Returns boolean

    Methods

    • Runs the node, normalizing every yielded item into an Event. This is what the engine (and ctx.runNode()) consumes. Validates the input against inputSchema once, up front (skipping genai Content, which nodes coerce themselves).

      Parameters

      Returns AsyncGenerator<Event, void, void>

    • Validates node input against inputSchema (Content passes through). Only enforced for Zod schemas; a genai Schema is left unvalidated (see parseWithSchema).

      Parameters

      • input: unknown

      Returns unknown

    • Validates node output against outputSchema (Content passes through). Only enforced for Zod schemas; a genai Schema is left unvalidated (see parseWithSchema).

      Parameters

      • output: unknown

      Returns unknown