LangGraph.js API Reference
    Preparing search index...

    Type Alias ToolCallWithResult<ToolCall>

    Represents a tool call paired with its result. Useful for rendering tool invocations and their outputs together.

    type ToolCallWithResult<ToolCall = DefaultToolCall> = {
        aiMessage: AIMessage<ToolCall>;
        call: ToolCall;
        id: string;
        index: number;
        result: ToolMessage | undefined;
        state: ToolCallState;
    }

    Type Parameters

    Index

    Properties

    aiMessage: AIMessage<ToolCall>

    The AI message that initiated this tool call.

    call: ToolCall

    The tool call from the AI message.

    id: string

    Unique identifier for this tool call. Uses the tool call's id if available, otherwise generates one from aiMessage.id and index.

    index: number

    Index of this tool call within the AI message's tool_calls array.

    result: ToolMessage | undefined

    The result message from tool execution. undefined if the tool is still being executed or no result was received.

    The current lifecycle state of the tool call.

    • pending: No result yet
    • completed: Has result with success status
    • error: Has result with error status