@pouchy_ai/companion-sdk - v0.1.0
    Preparing search index...

    Interface ToolCallEvent

    What onToolCall hands your handler: the companion.tool_call wire payload plus argsJsonargs pre-parsed as JSON. undefined when args is empty or not valid JSON; keep reading the raw args string when you need the exact model output.

    interface ToolCallEvent {
        args: string;
        argsJson?: unknown;
        id: string;
        name: string;
        replayed?: boolean;
    }

    Hierarchy (View Summary)

    Index
    args: string

    The model's arguments as a raw JSON string.

    argsJson?: unknown
    id: string

    Correlation id — echo it back on the tool result.

    name: string

    The declared tool name the model chose.

    replayed?: boolean

    True when this delivery is a REPLAY of a still-outstanding call from a turn that paused before a reconnect (see hello.ack pendingToolCalls) — the app may have already performed it and crashed before posting the result. Side-effecting tools should treat id as an idempotency key. Absent on the original live delivery.