Class McpSamplingRequestEventArgs
Provides data for the SamplingRequested event. Handlers should set the Response property to provide the sampling result.
public sealed class McpSamplingRequestEventArgs : EventArgs
- Inheritance
-
McpSamplingRequestEventArgs
- Inherited Members
Constructors
- McpSamplingRequestEventArgs(McpSamplingRequest)
Initializes a new instance of McpSamplingRequestEventArgs.
Properties
- Rejected
Gets or sets whether to reject this sampling request. When true, an error response will be sent to the server.
- RejectionReason
Gets or sets the rejection reason (if Rejected is true).
- Request
Gets the sampling request from the server.
- Response
Gets or sets the response to send back to the server. If null or not set, the request will be rejected.
- Timestamp
Gets the timestamp when this request was received.
Methods
- Accept(McpSamplingResponse)
Accepts the request with the specified response.
- Accept(string, string)
Accepts the request with a text response.
- Reject(string)
Rejects the request with the specified reason.