Class McpToolResult
java.lang.Object
com.soklet.McpToolResult
Immutable tool result used by v1 MCP tool handlers.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder used to constructMcpToolResultinstances. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull McpToolResult.Builderbuilder()Creates a builder forMcpToolResult.booleanstatic @NonNull McpToolResultfromErrorMessage(@NonNull String message) Creates an error result containing a single text message.Provides the text content blocks returned by the tool.Provides optional app-owned structured content to be marshaled into the MCP response.inthashCode()isError()Indicates whether the tool result represents an error result.toString()
-
Method Details
-
getContent
Provides the text content blocks returned by the tool.- Returns:
- the tool content blocks
-
getStructuredContent
Provides optional app-owned structured content to be marshaled into the MCP response.- Returns:
- the structured content, if present
-
isError
-
builder
Creates a builder forMcpToolResult.- Returns:
- a new builder
-
fromErrorMessage
Creates an error result containing a single text message.- Parameters:
message- the error message- Returns:
- an error tool result
-
equals
-
hashCode
-
toString
-