Package dev.langchain4j.mcp.client
Class DefaultMcpClient
java.lang.Object
dev.langchain4j.mcp.client.DefaultMcpClient
- All Implemented Interfaces:
McpClient
,AutoCloseable
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
executeTool
(ToolExecutionRequest executionRequest) Executes a tool on the MCP server and returns the result as a String.Obtains a list of tools from the MCP server.
-
Constructor Details
-
DefaultMcpClient
-
-
Method Details
-
listTools
Description copied from interface:McpClient
Obtains a list of tools from the MCP server. -
executeTool
Description copied from interface:McpClient
Executes a tool on the MCP server and returns the result as a String. Currently, this expects a tool execution to only contain text-based results.- Specified by:
executeTool
in interfaceMcpClient
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-