Interface McpResourcesAsToolsPresenter

All Known Implementing Classes:
DefaultMcpResourcesAsToolsPresenter

public interface McpResourcesAsToolsPresenter
A presenter that presents MCP resources (from one or more MCP clients) as tools to a chat model, allowing the chat model to discover and interact with resources. An implementation has to provide two tools, one for obtaining a list of resources, one for obtaining a particular resource. See DefaultMcpResourcesAsToolsPresenter for the default implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    dev.langchain4j.service.tool.ToolExecutor
    Create an executor for the tool that gets a particular resource.
    dev.langchain4j.agent.tool.ToolSpecification
    Create a specification for the tool that gets a particular resource.
    dev.langchain4j.service.tool.ToolExecutor
    Create an executor for the tool that lists available resources.
    dev.langchain4j.agent.tool.ToolSpecification
    Create a specification for the tool that lists available resources.
  • Method Details

    • createListResourcesSpecification

      dev.langchain4j.agent.tool.ToolSpecification createListResourcesSpecification()
      Create a specification for the tool that lists available resources.
    • createListResourcesExecutor

      dev.langchain4j.service.tool.ToolExecutor createListResourcesExecutor(List<McpClient> mcpClients)
      Create an executor for the tool that lists available resources.
    • createGetResourceSpecification

      dev.langchain4j.agent.tool.ToolSpecification createGetResourceSpecification()
      Create a specification for the tool that gets a particular resource.
    • createGetResourceExecutor

      dev.langchain4j.service.tool.ToolExecutor createGetResourceExecutor(List<McpClient> mcpClients)
      Create an executor for the tool that gets a particular resource.