Class DefaultMcpToolResultExtractor
java.lang.Object
dev.langchain4j.mcp.client.DefaultMcpToolResultExtractor
- All Implemented Interfaces:
McpToolResultExtractor
@Deprecated(since="1.20.0",
forRemoval=true)
public class DefaultMcpToolResultExtractor
extends Object
implements McpToolResultExtractor
Deprecated, for removal: This API element is subject to removal in a future version.
Default extractor for MCP tool responses backed by
content[].
This implementation preserves the existing client behavior: it only supports
content items of type text, joins multiple text fragments with
newline characters, and stores the result in ToolExecutionResult.resultText().
It does not apply to responses that contain structuredContent.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionextract(com.fasterxml.jackson.databind.JsonNode content, boolean isError) Deprecated, for removal: This API element is subject to removal in a future version.Extracts aToolExecutionResultfromCallToolResult.result.content[].
-
Constructor Details
-
DefaultMcpToolResultExtractor
public DefaultMcpToolResultExtractor()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
extract
public ToolExecutionResult extract(com.fasterxml.jackson.databind.JsonNode content, boolean isError) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:McpToolResultExtractorExtracts aToolExecutionResultfromCallToolResult.result.content[].- Specified by:
extractin interfaceMcpToolResultExtractor- Parameters:
content- the MCP tool result content array.isError- whether the tool response is marked as an application-level error.- Returns:
- the extracted
ToolExecutionResult.
-
DefaultMcpToolResultConverterinstead, which does not expose Jackson types.