ACP v2 (Preview) TypeScript SDK — UNSTABLE - v2.12.1
    Preparing search index...

    Type Alias McpRequestOptions

    Options for a single MCP-over-ACP request.

    type McpRequestOptions = {
        requestId?: string;
        signal?: AbortSignal;
        onNotification?: (notification: McpNotification) => void;
        sessionId?: string;
        toolCallId?: string;
        _meta?: Record<string, unknown>;
    }
    Index
    requestId?: string

    Logical MCP request ID. Defaults to a fresh random ID. Never reuse an ID that is still active for the same server on this connection.

    signal?: AbortSignal

    Aborting this signal sends $/cancel_request for the outer ACP request. Cancellation is best effort: the provider may still return a result.

    onNotification?: (notification: McpNotification) => void

    Receives MCP notifications belonging to this request, such as progress or subscription events. Notifications that arrive after the request settles are dropped.

    sessionId?: string

    The ACP session whose work caused this request: the sessionId the agent uses on session/update for that work. For a child session's work, pass the child's ID, even when the server was declared to its parent.

    Pass it whenever the session is known, because a provider can reject a request without it. Leave it out when the session is not known, and never pass the root session's ID or another guess in its place. The session has to be active on the connection, or an announced child of an active session, so a request sent before the session's setup response has none.

    toolCallId?: string

    The tool call in that session that this request is part of: the toolCallId the agent reports in session/update. Report the tool call before sending the request when possible. Leave it out for a tool call the agent does not report. Needs sessionId.

    _meta?: Record<string, unknown>

    Optional outer ACP metadata for the mcp/message envelope. This is separate from the inner MCP _meta inside params.