Interface AbstractMcpServer.ToolSpecificationBuilder<TExchange>

All Known Implementing Classes:
HttpStatelessMcpServer.HttpStatelessToolSpecificationBuilder, HttpStreamableMcpServer.HttpStreamableToolSpecificationBuilder, StdioMcpServer.StdioToolSpecificationBuilder
Enclosing class:
AbstractMcpServer

static interface AbstractMcpServer.ToolSpecificationBuilder<TExchange>
Interface for building tool and tool specification objects for MCP servers.

Implementations of this interface are responsible for constructing tool definitions and their corresponding specification objects, parameterized by the server's exchange type.

  • Method Summary

    Modifier and Type
    Method
    Description
    buildSpecification(Object tool, BiFunction<TExchange,io.modelcontextprotocol.spec.McpSchema.CallToolRequest,io.modelcontextprotocol.spec.McpSchema.CallToolResult> callHandler)
    Builds a tool specification object with the given tool and call handler.
  • Method Details

    • buildSpecification

      Object buildSpecification(Object tool, BiFunction<TExchange,io.modelcontextprotocol.spec.McpSchema.CallToolRequest,io.modelcontextprotocol.spec.McpSchema.CallToolResult> callHandler)
      Builds a tool specification object with the given tool and call handler.
      Parameters:
      tool - the tool object (implementation-specific type)
      callHandler - the handler function for tool invocation
      Returns:
      a tool specification object (implementation-specific type)