Member Junction
    Preparing search index...

    Fired BEFORE the agent invokes a registered client tool. Listeners can veto the dispatch by setting event.Cancel = trueAgentClientSession short-circuits, the tool handler does NOT run, afterToolInvoked does NOT fire, and the server receives a failure response carrying the optional CancelReason.

    onBeforeToolInvoked(event: BeforeToolInvokedEventArgs) {
    if (event.ToolName === 'deleteRecord') {
    if (!confirm('Agent wants to delete a record. Allow?')) {
    event.Cancel = true;
    event.CancelReason = 'User declined deletion';
    }
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Args: unknown
    Cancel: boolean = false
    CancelReason?: string
    ToolName: string