Class CallToolResult
java.lang.Object
org.apache.juneau.bean.mcp.v20250618.CallToolResult
Result payload for "tools/call".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContent(Collection<Content> value) Appends to the content blocks.addContent(Content... value) Appends to the content blocks.Content blocks returned by the tool.Whentrue, the tool reported an application-level error.Structured result content, mirroring thecontentin a machine-readable form.setContent(List<Content> value) Sets the content blocks.setContent(Content... value) Sets the content blocks.setIsError(Boolean value) Sets the error flag.setStructuredContent(Object value) Sets the structured content.
-
Constructor Details
-
CallToolResult
public CallToolResult()
-
-
Method Details
-
getContent
Content blocks returned by the tool.- Returns:
- The content list, or
nullif not set.
-
setContent
Sets the content blocks.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
setContent
Sets the content blocks.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
addContent
Appends to the content blocks.- Parameters:
value- The values to append.- Returns:
- This object (for method chaining).
-
addContent
Appends to the content blocks.- Parameters:
value- The values to append.- Returns:
- This object (for method chaining).
-
getIsError
Whentrue, the tool reported an application-level error.- Returns:
- The flag, or
nullif not set.
-
setIsError
Sets the error flag.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getStructuredContent
Structured result content, mirroring thecontentin a machine-readable form.MCP 2025-06-18 requires this, when present, to be a JSON object, but enforcement of that constraint belongs to the REST adapter, not this DTO.
- Returns:
- The structured content, or
nullif not set.
-
setStructuredContent
Sets the structured content.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-