Class GenericMCPToolAdapter

All Implemented Interfaces:
GuardedExecution, Identifiable, Job<MCPToolResult>, Tool<MCPToolInput, MCPToolResult>

public class GenericMCPToolAdapter extends AbstractTool<MCPToolInput, MCPToolResult>
Adapts an MCP-served tool to the Nucleo tool framework. Wraps an MCPClient and a specific MCPToolDescriptor, exposing the standard Tool contract so MCP tools participate in thinker tool loops alongside native ones.

The adapter takes a connector MCPHandle so observability metadata (obs.mcp.handle, obs.mcp.tool) and the namespaced LLM-facing identity stay consistent with MCPToolProvider.name().

Since:
0.1 (2026-01-10)
Author:
Andrey Santrosyan
  • Constructor Details

    • GenericMCPToolAdapter

      public GenericMCPToolAdapter(Identifiable parent, MCPClient client, MCPToolDescriptor descriptor, MCPHandle handle)
      Creates an adapter for a specific MCP tool.
      Parameters:
      parent - the parent for lineage tracking
      client - the MCP client to use for tool calls
      descriptor - the descriptor for the specific tool to wrap
      handle - the connector handle that owns this tool (required so observability metadata and namespacing line up with the provider)
  • Method Details