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

    Type Alias McpAdmissionRequest

    One mcp/message request, as McpServerOptions.admit sees it before the server's handler runs.

    type McpAdmissionRequest = {
        serverId: string;
        requestId: string;
        method: string;
        params: Record<string, unknown> | undefined;
        toolName: string | undefined;
        sessionId: string | undefined;
        toolCallId: string | undefined;
        signal: AbortSignal;
        requireSession(): string;
        rejectSession(message?: string): never;
    }
    Index
    serverId: string

    The declared server the request is addressed to.

    requestId: string

    The caller's logical MCP request ID.

    method: string

    Inner MCP method, such as tools/call or server/discover.

    params: Record<string, unknown> | undefined

    Inner MCP params. null and omission are both undefined.

    toolName: string | undefined

    The tool a tools/call request names: its params.name. undefined for every other method, and for a tools/call without a string name.

    sessionId: string | undefined

    The ACP session whose work caused this request, if the caller named one. See McpOperationContext.sessionId.

    toolCallId: string | undefined

    The tool call in that session that this request is part of, if the caller named one. See McpOperationContext.toolCallId.

    signal: AbortSignal

    Aborts when the caller cancels this request, the server registration is disposed, or the ACP connection closes. It is the signal the handler would get as McpOperationContext.signal. An asynchronous check can stop early on it. The request then ends as cancelled, whatever the check does.

    • Returns sessionId. If the caller named none, throws an McpSessionError that says this server needs to know the session and the agent did not say.

      Returns string

    • Throws an McpSessionError with message, for a session that the server's own check refuses: for example, one that is not active on this connection, or one the server was not declared to. Without a message, the error names the rejected sessionId, or says what requireSession says when the request has none.

      Parameters

      • Optionalmessage: string

      Returns never