Interface McpToolResultExtractor

All Known Implementing Classes:
DefaultMcpToolResultExtractor

@Deprecated(since="1.20.0", forRemoval=true) public interface McpToolResultExtractor
Deprecated, for removal: This API element is subject to removal in a future version.
use McpToolResultConverter, which does not expose Jackson types.
Extracts a ToolExecutionResult from a tool response content[] array.

This extension point is only used for ordinary MCP tool responses that return CallToolResult.result.content[]. It is not invoked when the MCP server returns structuredContent, which is handled separately.

This interface is not a general-purpose MCP content parsing framework. The default client only supports structuredContent and text content out of the box. More specialized extraction strategies can be provided through DefaultMcpClient.Builder.toolResultExtractor(McpToolResultExtractor).

  • Method Summary

    Modifier and Type
    Method
    Description
    extract(com.fasterxml.jackson.databind.JsonNode content, boolean isError)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Extracts a ToolExecutionResult from CallToolResult.result.content[].
  • Method Details

    • extract

      ToolExecutionResult extract(com.fasterxml.jackson.databind.JsonNode content, boolean isError)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Extracts a ToolExecutionResult from CallToolResult.result.content[].
      Parameters:
      content - the MCP tool result content array.
      isError - whether the tool response is marked as an application-level error.
      Returns:
      the extracted ToolExecutionResult.