Class McpToolOutput.Builder
java.lang.Object
com.soklet.McpToolOutput.Builder
- Enclosing class:
McpToolOutput
Mutable builder for immutable
McpToolOutput.- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()content(@Nullable List<? extends @NonNull McpContentBlock> content) Replaces content blocks in supplied order.Sets whether the tool result is an application-level error.structuredContent(@NonNull McpJsonValue structuredContent) Sets structured JSON content.
-
Method Details
-
content
public @NonNull McpToolOutput.Builder content(@Nullable List<? extends @NonNull McpContentBlock> content) Replaces content blocks in supplied order. Null or empty clears the property. The complete list is validated and snapshotted before replacing the prior value.- Parameters:
content- content blocks, or null to clear- Returns:
- this builder
- Throws:
NullPointerException- if a list element is null
-
structuredContent
Sets structured JSON content.- Parameters:
structuredContent- structured JSON value- Returns:
- this builder
-
error
Sets whether the tool result is an application-level error.- Parameters:
error- error state- Returns:
- this builder
- Throws:
NullPointerException- iferroris null
-
build
- Returns:
- immutable tool output
-