Class McpToolExecutor

java.lang.Object
dev.langchain4j.mcp.McpToolExecutor
All Implemented Interfaces:
ToolExecutor

public class McpToolExecutor extends Object implements ToolExecutor
Since:
1.4.0
  • Constructor Details

    • McpToolExecutor

      public McpToolExecutor(McpClient mcpClient)
  • Method Details

    • execute

      public String execute(ToolExecutionRequest executionRequest, Object memoryId)
      Description copied from interface: ToolExecutor
      Executes a tool requests.
      Specified by:
      execute in interface ToolExecutor
      Parameters:
      executionRequest - The tool execution request. Contains tool name and arguments.
      memoryId - The ID of the chat memory. See MemoryId for more details.
      Returns:
      The result of the tool execution that will be sent to the LLM.