Skip to content

datarobot_genai.drmcp.core.dynamic_tools.register

register

register_external_tool async

register_external_tool(config: ExternalToolRegistrationConfig, **kwargs: Any) -> Tool

Create and register a generic HTTP tool in the MCP server.

Parameters:

Name Type Description Default
config ExternalToolRegistrationConfig

ExternalToolRegistrationConfig object containing all tool parameters.

required
**kwargs Any

Additional keyword arguments to pass to tools registration.

{}
Returns
The registered Tool instance with full MCP integration.
Source code in datarobot_genai/drmcp/core/dynamic_tools/register.py
async def register_external_tool(config: ExternalToolRegistrationConfig, **kwargs: Any) -> Tool:
    """Create and register a generic HTTP tool in the MCP server.

    Args:
        config: ExternalToolRegistrationConfig object containing all tool parameters.
        **kwargs: Additional keyword arguments to pass to tools registration.

    Returns
    -------
        The registered Tool instance with full MCP integration.
    """
    external_tool_callable = _external_tool_callable_factory(
        config,
        allow_empty=get_config().mcp_server_tool_registration_allow_empty_schema,
    )

    registered_tool = await register_tools(
        fn=external_tool_callable,
        name=config.name,
        title=config.title,
        description=config.description,
        tags=config.tags,
        **kwargs,
    )

    return registered_tool