Class DefaultMcpToolResultConverter
java.lang.Object
dev.langchain4j.mcp.client.DefaultMcpToolResultConverter
- All Implemented Interfaces:
McpToolResultConverter
Default converter for MCP tool responses backed by
content[].
It only supports content items of type text, joins multiple text
fragments with newline characters, and stores the result in
ToolExecutionResult.resultText().
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DefaultMcpToolResultConverter
public DefaultMcpToolResultConverter()
-
-
Method Details
-
convert
- Specified by:
convertin interfaceMcpToolResultConverter- Parameters:
content- the content blocks ofCallToolResult.isError- whether the tool response is marked as an application-level error.- Returns:
- the result to hand back to the caller, whose text is what the model sees.
-