Record Class ToolCallResult
java.lang.Object
java.lang.Record
org.ek9lang.mcp.model.ToolCallResult
Result of a tools/call request.
-
Constructor Summary
ConstructorsConstructorDescriptionToolCallResult(List<ToolContent> content, boolean isError) Creates an instance of aToolCallResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.static ToolCallResultCreate an error result.final inthashCode()Returns a hash code value for this object.booleanisError()Returns the value of theisErrorrecord component.static ToolCallResultCreate a successful result with a single text content.static ToolCallResultsuccessJson(String json) Create a successful result with JSON content.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ToolCallResult
Creates an instance of aToolCallResultrecord class.- Parameters:
content- the value for thecontentrecord componentisError- the value for theisErrorrecord component
-
-
Method Details
-
success
Create a successful result with a single text content. -
successJson
Create a successful result with JSON content. -
error
Create an error result. -
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
isError
public boolean isError()Returns the value of theisErrorrecord component.- Returns:
- the value of the
isErrorrecord component
-