Class McpToolResult.Builder
java.lang.Object
com.soklet.McpToolResult.Builder
- Enclosing class:
McpToolResult
Builder used to construct
McpToolResult instances.- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the immutable tool result.content(@NonNull McpTextContent content) Appends a content block to the result.content(@NonNull List<@NonNull McpTextContent> content) Appends multiple content blocks to the result in order.Sets whether the result should be flagged as an error result.structuredContent(@Nullable Object structuredContent) Sets the structured content value to be marshaled into the tool result.
-
Method Details
-
content
Appends a content block to the result.- Parameters:
content- the content block to append- Returns:
- this builder
-
content
Appends multiple content blocks to the result in order.- Parameters:
content- the content blocks to append- Returns:
- this builder
-
structuredContent
Sets the structured content value to be marshaled into the tool result.- Parameters:
structuredContent- the structured content value, possiblynull- Returns:
- this builder
-
isError
Sets whether the result should be flagged as an error result.- Parameters:
error- the error flag- Returns:
- this builder
-
build
Builds the immutable tool result.- Returns:
- the built tool result
-