@modelcontextprotocol/sdk
    Preparing search index...

    Type Alias RequestHandlerExtra<SendRequestT, SendNotificationT>

    Extra data given to request handlers.

    type RequestHandlerExtra<
        SendRequestT extends Request,
        SendNotificationT extends Notification,
    > = {
        _meta?: RequestMeta;
        authInfo?: AuthInfo;
        requestId: RequestId;
        requestInfo?: RequestInfo;
        sendNotification: (notification: SendNotificationT) => Promise<void>;
        sendRequest: <U extends ZodType<object>>(
            request: SendRequestT,
            resultSchema: U,
            options?: RequestOptions,
        ) => Promise<z.infer<U>>;
        sessionId?: string;
        signal: AbortSignal;
    }

    Type Parameters

    Index

    Properties

    _meta?: RequestMeta

    Metadata from the original request.

    authInfo?: AuthInfo

    Information about a validated access token, provided to request handlers.

    requestId: RequestId

    The JSON-RPC ID of the request being handled. This can be useful for tracking or logging purposes.

    requestInfo?: RequestInfo

    The original HTTP request.

    sendNotification: (notification: SendNotificationT) => Promise<void>

    Sends a notification that relates to the current request being handled.

    This is used by certain transports to correctly associate related messages.

    sendRequest: <U extends ZodType<object>>(
        request: SendRequestT,
        resultSchema: U,
        options?: RequestOptions,
    ) => Promise<z.infer<U>>

    Sends a request that relates to the current request being handled.

    This is used by certain transports to correctly associate related messages.

    sessionId?: string

    The session ID from the transport, if available.

    signal: AbortSignal

    An abort signal used to communicate if the request was cancelled from the sender's side.