langchain.js
    Preparing search index...

    Interface ToolCallRequest<TState, TContext>

    Represents a tool call request for the wrapToolCall hook. Contains the tool call information along with the agent's current state and runtime.

    interface ToolCallRequest<
        TState extends Record<string, unknown> = Record<string, unknown>,
        TContext = unknown,
    > {
        runtime: Runtime<TContext>;
        state: TState & AgentBuiltInState;
        tool: any;
        toolCall: ToolCall;
    }

    Type Parameters

    • TState extends Record<string, unknown> = Record<string, unknown>
    • TContext = unknown
    Index

    Properties

    runtime: Runtime<TContext>

    The runtime context containing metadata, signal, writer, interrupt, etc.

    state: TState & AgentBuiltInState

    The current agent state (includes both middleware state and built-in state).

    tool: any

    The BaseTool instance being invoked. Provides access to tool metadata like name, description, schema, etc.

    toolCall: ToolCall

    The tool call to be executed