Package io.modelcontextprotocol.spec
Record Class McpSchema.ToolAnnotations
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.ToolAnnotations
- Enclosing class:
- McpSchema
public static record McpSchema.ToolAnnotations(String title, Boolean readOnlyHint, Boolean destructiveHint, Boolean idempotentHint, Boolean openWorldHint, Boolean returnDirect)
extends Record
Additional properties describing a Tool to clients.
NOTE: all properties in ToolAnnotations are **hints**. They are not guaranteed to
provide a faithful description of tool behavior (including descriptive properties
like `title`).
Clients should never make tool use decisions based on ToolAnnotations received from
untrusted servers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedestructiveHintrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theidempotentHintrecord component.Returns the value of theopenWorldHintrecord component.Returns the value of thereadOnlyHintrecord component.Returns the value of thereturnDirectrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ToolAnnotations
public ToolAnnotations(String title, Boolean readOnlyHint, Boolean destructiveHint, Boolean idempotentHint, Boolean openWorldHint, Boolean returnDirect) Creates an instance of aToolAnnotationsrecord class.- Parameters:
title- the value for thetitlerecord componentreadOnlyHint- the value for thereadOnlyHintrecord componentdestructiveHint- the value for thedestructiveHintrecord componentidempotentHint- the value for theidempotentHintrecord componentopenWorldHint- the value for theopenWorldHintrecord componentreturnDirect- the value for thereturnDirectrecord component
-
-
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). -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
readOnlyHint
Returns the value of thereadOnlyHintrecord component.- Returns:
- the value of the
readOnlyHintrecord component
-
destructiveHint
Returns the value of thedestructiveHintrecord component.- Returns:
- the value of the
destructiveHintrecord component
-
idempotentHint
Returns the value of theidempotentHintrecord component.- Returns:
- the value of the
idempotentHintrecord component
-
openWorldHint
Returns the value of theopenWorldHintrecord component.- Returns:
- the value of the
openWorldHintrecord component
-
returnDirect
Returns the value of thereturnDirectrecord component.- Returns:
- the value of the
returnDirectrecord component
-