Member Junction
    Preparing search index...

    Event emitted when a client tool request is received from the server. Raised BEFORE execution — subscribers can observe what tools are being invoked, AND veto the dispatch by setting Cancel = true (cancel-enforcement).

    Cancel semantics: the host's RxJS subscriber runs synchronously inside the Subject.next() call. After the synchronous notify completes, AgentClientSession.handleToolRequest reads event.Cancel; if true, the tool handler is NOT executed, AgentClientSession.ToolExecuted$ does NOT fire, and a failure result is sent back to the server with Tool dispatch canceled by host[: <CancelReason>] as the error message.

    Use cases: permission/role gates, destructive-action confirmation dialogs, rate-limit caps, and other host-side policy decisions that must run before a tool side-effect happens. For pure observation (analytics, logging), leave Cancel at its default false.

    interface ClientToolRequestEvent {
        AgentRunID: string;
        Cancel: boolean;
        CancelReason?: string;
        Request: ClientToolRequest;
    }
    Index

    Properties

    AgentRunID: string

    The agent run that triggered this request

    Cancel: boolean

    When set to true by any synchronous subscriber, the session will short-circuit dispatch: no tool handler runs, ToolExecuted$ is NOT emitted, and a failure response is sent to the server. Defaults to false (proceed with dispatch).

    CancelReason?: string

    Optional human-readable reason set alongside Cancel = true. Surfaced in the server-side error message (Tool dispatch canceled by host: <reason>) so the agent can adapt its next turn.

    The raw request from the server