Package io.modelcontextprotocol.spec
Record Class McpSchema.ClientCapabilities.Sampling
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.ClientCapabilities.Sampling
- Enclosing class:
- McpSchema.ClientCapabilities
Provides a standardized way for servers to request LLM
sampling ("completions" or "generations") from language
models via clients. This flow allows clients to maintain
control over model access, selection, and permissions
while enabling servers to leverage AI capabilities—with
no server API keys necessary. Servers can request text or
image-based interactions and optionally include context
from MCP servers in their prompts.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Sampling
public Sampling()Creates an instance of aSamplingrecord class.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal.
-