Class SamplingCapability
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents the capability for a client to generate text or other content using an AI model.
public sealed class SamplingCapability
- Inheritance
-
SamplingCapability
- Inherited Members
Remarks
This capability enables the MCP client to respond to sampling requests from an MCP server.
When this capability is enabled, an MCP server can request the client to generate content using an AI model. The client must set a SamplingHandler to process these requests.
Properties
Context
Gets or sets whether the client supports context inclusion via includeContext parameter.
[JsonPropertyName("context")]
public SamplingContextCapability? Context { get; set; }
Property Value
Remarks
If not declared, servers should only use includeContext: "none".
Tools
Gets or sets whether the client supports tool use via tools and toolChoice parameters.
[JsonPropertyName("tools")]
public SamplingToolsCapability? Tools { get; set; }