data_designer.engine.mcp.registry
data_designer.engine.mcp.registry
data_designer.engine.mcp.registry
Definition of an MCP tool with its schema.
Convert this tool definition to OpenAI function calling format.
Returns:
dict[str, typing.Any]
A dictionary in OpenAI’s tool schema format with ‘type’ set to ‘function’ and nested ‘function’ containing name, description, and parameters.
Result from executing an MCP tool call.
Registry for MCP tool configurations and facades.
MCPRegistry manages ToolConfig instances by tool_alias and lazily creates MCPFacade instances when requested. This is a config-only registry - all actual MCP operations are delegated to the MCPFacade and io module.
This mirrors the ModelRegistry pattern for consistency across the codebase.
Initialization:
Initialize the MCPRegistry.
Parameters:
Resolver for secrets referenced in provider configs.
Registry of MCP provider configurations.
Factory for creating MCPFacade instances.
Optional list of tool configurations to register.
Get all registered tool configurations.
Get all instantiated facades.
Get the MCP provider registry.
Register tool configurations at runtime.
Parameters:
List of tool configurations to register. If a configuration with the same alias already exists, it will be overwritten.
Get or lazily create an MCPFacade for the given tool alias.
Parameters:
The alias of the tool configuration.
Returns:
data_designer.engine.mcp.facade.MCPFacade
An MCPFacade configured for the specified tool alias.
Raises:
If no tool config with the given alias is found.
Get a tool configuration by alias.
Parameters:
The alias of the tool configuration.
Returns:
data_designer.config.mcp.ToolConfig
The tool configuration.
Raises:
If no tool config with the given alias is found.
Set tool configurations from a list.
Create an MCPFacade for a tool configuration.
Validate that no ToolConfig has duplicate tool names across its providers.
This method eagerly fetches tool schemas for all registered ToolConfigs, which triggers duplicate tool name detection. This catches cases where multiple providers in the same ToolConfig expose a tool with the same name.
Raises:
If any ToolConfig has duplicate tool names across providers.