GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — ToolNode | ADK for TypeScript: API Reference - v2.5.0

  • ToolNode

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)

  • BaseNode
    • ToolNode
  • Defined in core/src/workflow/nodes/tool_node.ts:35

Constructors

constructor

  • new ToolNode(tool: BaseTool, config?: ToolNodeConfig): ToolNode

    Parameters

    • tool: BaseTool
    • config: ToolNodeConfig = {}

    Returns ToolNode

    Overrides BaseNode.constructor

    • Defined in core/src/workflow/nodes/tool_node.ts:38

Properties

Readonly[BASE_NODE_SIGNATURE_SYMBOL]

"[BASE_NODE_SIGNATURE_SYMBOL]": true

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

Inherited from BaseNode.[BASE_NODE_SIGNATURE_SYMBOL]

  • Defined in core/src/workflow/base_node.ts:88

Readonlydescription

description: string

Inherited from BaseNode.description

  • Defined in core/src/workflow/base_node.ts:91

Optional ReadonlyinputSchema

inputSchema?: SchemaLike

Inherited from BaseNode.inputSchema

  • Defined in core/src/workflow/base_node.ts:102

Optional ReadonlyisolationScope

isolationScope?: string | true

Inherited from BaseNode.isolationScope

  • Defined in core/src/workflow/base_node.ts:105

Readonlyname

name: string

Inherited from BaseNode.name

  • Defined in core/src/workflow/base_node.ts:90

Optional ReadonlyoutputSchema

outputSchema?: SchemaLike

Inherited from BaseNode.outputSchema

  • Defined in core/src/workflow/base_node.ts:103

Optional ReadonlypreparedRetryConfig

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.

Inherited from BaseNode.preparedRetryConfig

  • Defined in core/src/workflow/base_node.ts:100

ReadonlyrerunOnResume

rerunOnResume: boolean

Inherited from BaseNode.rerunOnResume

  • Defined in core/src/workflow/base_node.ts:92

Optional ReadonlyretryConfig

retryConfig?: RetryConfig

Inherited from BaseNode.retryConfig

  • Defined in core/src/workflow/base_node.ts:94

Optional ReadonlystateSchema

stateSchema?: SchemaLike

Inherited from BaseNode.stateSchema

  • Defined in core/src/workflow/base_node.ts:104

Optional Readonlytimeout

timeout?: number

Inherited from BaseNode.timeout

  • Defined in core/src/workflow/base_node.ts:101

Readonlytool

tool: BaseTool
  • Defined in core/src/workflow/nodes/tool_node.ts:36

ReadonlywaitForOutput

waitForOutput: boolean

Inherited from BaseNode.waitForOutput

  • Defined in core/src/workflow/base_node.ts:93

Accessors

requiresAllPredecessors

  • 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

    Inherited from BaseNode.requiresAllPredecessors

    • Defined in core/src/workflow/base_node.ts:134

Methods

run

  • run(ctx: NodeContext, input: unknown): AsyncGenerator<Event, void, void>

    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

    • ctx: NodeContext
    • input: unknown

    Returns AsyncGenerator<Event, void, void>

    Inherited from BaseNode.run

    • Defined in core/src/workflow/base_node.ts:155

ProtectedrunImpl

  • runImpl(ctx: NodeContext, input: unknown): AsyncGenerator<Event, void, void>

    Core execution contract. Subclasses yield one of:

    • an Event (emitted as-is),
    • a raw value (boxed into an event whose output is that value),
    • null/undefined (skipped).

    Parameters

    • ctx: NodeContext
    • input: unknown

    Returns AsyncGenerator<Event, void, void>

    Overrides BaseNode.runImpl

    • Defined in core/src/workflow/nodes/tool_node.ts:52

ProtectedtoEvent

  • toEvent(ctx: NodeContext, data: unknown): Event | null

    Normalizes a single yielded item into an Event (or null to skip). Subclasses may override for richer coercion (e.g. FunctionNode).

    Parameters

    • ctx: NodeContext
    • data: unknown

    Returns Event | null

    Inherited from BaseNode.toEvent

    • Defined in core/src/workflow/base_node.ts:217

ProtectedvalidateInput

  • validateInput(input: unknown): unknown

    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

    Inherited from BaseNode.validateInput

    • Defined in core/src/workflow/base_node.ts:178

ProtectedvalidateOutput

  • validateOutput(output: unknown): 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

    Inherited from BaseNode.validateOutput

    • Defined in core/src/workflow/base_node.ts:198
Constructors
constructor
Properties
[BASE_NODE_SIGNATURE_SYMBOL]descriptioninputSchemaisolationScopenameoutputSchemapreparedRetryConfigrerunOnResumeretryConfigstateSchematimeouttoolwaitForOutput
Accessors
requiresAllPredecessors
Methods
runrunImpltoEventvalidateInputvalidateOutput
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.