Class CallToolResult

java.lang.Object
org.apache.juneau.bean.mcp.v20250618.CallToolResult

@Marshalled public class CallToolResult extends Object
Result payload for "tools/call".
  • Constructor Details

  • Method Details

    • getContent

      public List<Content> getContent()
      Content blocks returned by the tool.
      Returns:
      The content list, or null if not set.
    • setContent

      Sets the content blocks.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • setContent

      public CallToolResult setContent(Content... value)
      Sets the content blocks.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • addContent

      public CallToolResult addContent(Content... value)
      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

      public Boolean getIsError()
      When true, the tool reported an application-level error.
      Returns:
      The flag, or null if not set.
    • setIsError

      Sets the error flag.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).
    • getStructuredContent

      Structured result content, mirroring the content in 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 null if not set.
    • setStructuredContent

      Sets the structured content.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object (for method chaining).