RequestOptions

class RequestOptions(relatedRequestId: RequestId? = null, resumptionToken: String? = null, onResumptionToken: (String) -> Unit? = null, val onProgress: ProgressCallback? = null, val timeout: Duration = DEFAULT_REQUEST_TIMEOUT) : TransportSendOptions(source)

Options that can be given per request.

Constructors

Link copied to clipboard
constructor(relatedRequestId: RequestId? = null, resumptionToken: String? = null, onResumptionToken: (String) -> Unit? = null, onProgress: ProgressCallback? = null, timeout: Duration = DEFAULT_REQUEST_TIMEOUT)

Properties

Link copied to clipboard

callback for progress notifications. If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.

Link copied to clipboard

a callback that is invoked when the resumption token changes, if supported by the transport. This allows clients to persist the latest token for potential reconnection.

Link copied to clipboard

if present, relatedRequestId is used to indicate to the transport which incoming request to associate this outgoing message with.

Link copied to clipboard

the resumption token used to continue long-running requests that were interrupted. This allows clients to reconnect and continue from where they left off, if supported by the transport.

Link copied to clipboard

a timeout for this request. If exceeded, a McpException with code RequestTimeout will be raised from request(). If not specified, DEFAULT_REQUEST_TIMEOUT will be used as the timeout.

Functions

Link copied to clipboard
operator fun component1(): RequestId?

Destructuring component for relatedRequestId.

Link copied to clipboard
operator fun component2(): String?

Destructuring component for resumptionToken.

Link copied to clipboard
operator fun component3(): (String) -> Unit?

Destructuring component for onResumptionToken.

Link copied to clipboard
operator fun component4(): ProgressCallback?

Destructuring component for onProgress.

Link copied to clipboard
operator fun component5(): Duration

Destructuring component for timeout.

Link copied to clipboard
fun copy(relatedRequestId: RequestId? = this.relatedRequestId, resumptionToken: String? = this.resumptionToken, onResumptionToken: (String) -> Unit? = this.onResumptionToken, onProgress: ProgressCallback? = this.onProgress, timeout: Duration = this.timeout): RequestOptions

Creates a copy of this RequestOptions with the specified fields replaced.

open fun copy(relatedRequestId: RequestId? = this.relatedRequestId, resumptionToken: String? = this.resumptionToken, onResumptionToken: (String) -> Unit? = this.onResumptionToken): TransportSendOptions

Creates a copy of this TransportSendOptions with the specified fields replaced.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String