Package io.modelcontextprotocol.spec
Record Class McpSchema.ClientCapabilities.Elicitation
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.ClientCapabilities.Elicitation
- Record Components:
form- support for in-band form-based elicitationurl- support for out-of-band URL-based elicitation
- Enclosing class:
- McpSchema.ClientCapabilities
public static record McpSchema.ClientCapabilities.Elicitation(McpSchema.ClientCapabilities.Elicitation.Form form, McpSchema.ClientCapabilities.Elicitation.Url url)
extends Record
Provides a standardized way for servers to request additional information from
users through the client during interactions. This flow allows clients to
maintain control over user interactions and data sharing while enabling servers
to gather necessary information dynamically. Servers can request structured
data from users with optional JSON schemas to validate responses.
Per the 2025-11-25 spec, clients can declare support for specific elicitation modes:
form- In-band structured data collection with optional schema validationurl- Out-of-band interaction via URL navigation
For backward compatibility, an empty elicitation object {} is
equivalent to declaring support for form mode only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordMarker record indicating support for form-based elicitation mode.static final recordMarker record indicating support for URL-based elicitation mode. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an Elicitation with default settings (backward compatible, produces empty JSON object).Elicitation(McpSchema.ClientCapabilities.Elicitation.Form form, McpSchema.ClientCapabilities.Elicitation.Url url) Creates an instance of aElicitationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.form()Returns the value of theformrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.url()Returns the value of theurlrecord component.
-
Constructor Details
-
Elicitation
public Elicitation()Creates an Elicitation with default settings (backward compatible, produces empty JSON object). -
Elicitation
public Elicitation(McpSchema.ClientCapabilities.Elicitation.Form form, McpSchema.ClientCapabilities.Elicitation.Url url) Creates an instance of aElicitationrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
form
Returns the value of theformrecord component.- Returns:
- the value of the
formrecord component
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-