# Dynamic tool registration

> Dynamic tool registration - Learn how the MCP server discovers DataRobot deployments and exposes
> them as MCP tools automatically.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-08-30T06:11:45.585312+00:00` (UTC).

## Primary page

- [Dynamic tool registration](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [Quick start](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#quick-start): In-page section heading.
- [Supported deployment types](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#supported-deployment-types): In-page section heading.
- [Registration requirements](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#registration-requirements): In-page section heading.
- [Runtime API](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#runtime-api): In-page section heading.
- [DRUM deployments](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#drum-deployments): In-page section heading.
- [Zero configuration (for most cases)](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#zero-configuration-for-most-cases): In-page section heading.
- [Unstructured models](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#unstructured-models): In-page section heading.
- [Optional custom schema](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#optional-custom-schema): In-page section heading.
- [Custom server deployments](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#custom-server-deployments): In-page section heading.
- [Required/info/response](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#required-info-response): In-page section heading.
- [FastAPI example](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#fastapi-example): In-page section heading.
- [Request mapping](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#request-mapping): In-page section heading.
- [Input schema reference](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#input-schema-reference): In-page section heading.
- [Parameter groups](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#parameter-groups): In-page section heading.
- [Rules](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#rules): In-page section heading.
- [What the server does](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#what-the-server-does): In-page section heading.
- [Troubleshooting](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#troubleshooting): In-page section heading.
- [Tool does not register](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#tool-does-not-register): In-page section heading.
- [Common errors](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#common-errors): In-page section heading.
- [Additional resources](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-dynamic-tool-registration.html.md#additional-resources): In-page section heading.

## Related documentation

- [Agentic AI](https://docs.datarobot.com/en/docs/agentic-ai/index.html.md): Linked from this page.
- [MCP](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/index.html.md): Linked from this page.
- [Integrate tools using an MCP server](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-tools-mcp.html.md): Linked from this page.
- [Connect agentic coding environments to MCP servers](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-mcp-clients.html.md): Linked from this page.

## Documentation content

Dynamic tool registration lets the MCP server discover DataRobot deployments and expose them as MCP tools automatically. When a tool is invoked, the server proxies the request to the registered deployment.

This capability is available in MCP servers built with the [DataRobot MCP template](https://github.com/datarobot-community/af-component-datarobot-mcp) and the [DataRobot Agentic Starter template](https://github.com/datarobot-community/datarobot-agent-application). For MCP server setup and agent integration, see [Integrate tools using an MCP server](https://docs.datarobot.com/en/docs/agentic-ai/agentic-mcp/agentic-tools-mcp.html.md).

## Quick start

1. Deploy your model or service to DataRobot.
2. Tag the deployment with tool as both the tag name and the tag value.
3. Start the server with dynamic tool registration enabled, if needed.

To enable auto-discovery on startup (optional):

```
MCP_SERVER_REGISTER_DYNAMIC_TOOLS_ON_STARTUP=true
```

For most deployment types, no additional configuration is needed.

## Supported deployment types

| Deployment type | Configuration needed |
| --- | --- |
| DataRobot native predictive models | None. Tag the deployment as tool. |
| DRUM structured predictions | None. Optionally define inputSchema in model-metadata.yaml. |
| DRUM agentic workflows | None. Optionally define inputSchema in model-metadata.yaml. |
| DRUM unstructured models | Define inputSchema in model-metadata.yaml. |
| Custom servers, such as FastAPI services | Expose an /info/ endpoint with tool metadata. |

Registering other MCP servers as tools through dynamic tool registration is not supported.

## Registration requirements

All deployments must:

- Be active.
- Be tagged with tool as both the name and value.

Additional requirements depend on the deployment type:

- DataRobot native models : No extra requirements.
- DRUM unstructured models : Define inputSchema in model-metadata.yaml .
- Custom servers : Expose /info/ and return endpoint , method , and input_schema .

### Runtime API

Use these endpoints on the MCP server to manage registrations at runtime:

- GET /registeredDeployments : List registered tools.
- PUT /registeredDeployments/{deployment_id} : Register a tool.
- DELETE /registeredDeployments/{deployment_id} : Remove a tool.

For example, the `GET /registeredDeployments` endpoint can be implemented as follows:

```
# List registered deployments (excerpt)
@mcp.custom_route(prefix_mount_path("/registeredDeployments"), methods=["GET"])
async def list_deployments(_: Request) -> JSONResponse:
    """List all deployments."""
    try:
        deployments = await get_registered_tool_deployments()
        formatted_deployments = [
            {"deploymentId": k, "toolName": v} for k, v in deployments.items()
        ]
        return JSONResponse(
            status_code=HTTPStatus.OK,
            content={
                "deployments": formatted_deployments,
                "count": len(deployments),
            },
        )
    except Exception as e:
        return JSONResponse(
            status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
            content={"error": f"Failed to retrieve deployments: {str(e)}"},
        )
```

## DRUM deployments

[DataRobot DRUM](https://pypi.org/project/datarobot-drum/) deployments usually work with little or no additional configuration.

### Zero configuration (for most cases)

For these deployment types, tag the deployment as `tool` and the server can register it automatically:

- Structured predictions, including binary, regression, and multiclass models.
- Agentic workflows.
- DataRobot native predictive models.

### Unstructured models

For an `unstructured` target type, add `inputSchema` to `model-metadata.yaml`:

```
# model-metadata.yaml
name: "Fetch dataset"
description: "Fetches a dataset from DataRobot Data Registry"
type: inference
targetType: unstructured
inputSchema:
  type: object
  properties:
    json:
      type: object
      properties:
        dataset_id:
          type: string
          description: Dataset ID from Data Registry
        limit:
          type: integer
          default: 100
      required:
        - dataset_id
```

> [!NOTE] Unstructured model schemas
> For unstructured models, define request parameters under the
> json
> property.
> Exposing input schemas from
> model-metadata.yaml
> requires
> datarobot-drum
> version
> 1.17.2
> or later.

### Optional custom schema

You can override fallback schemas to give the LLM better guidance or tighter control over the request shape:

```
# model-metadata.yaml (custom inputSchema)
inputSchema:
  type: object
  properties:
    data:
      type: string
      description: "CSV with columns: transaction_amount, user_age, merchant_category"
  required:
    - data
```

## Custom server deployments

For FastAPI, Flask, and similar services, expose an `/info/` endpoint that returns tool metadata.

### Required /info/ response

```
{
  "endpoint": "directAccess/weather/{city}",
  "method": "GET",
  "input_schema": {
    "type": "object",
    "properties": {
      "path_params": {
        "type": "object",
        "properties": {
          "city": {
            "type": "string",
            "description": "City name"
          }
        },
        "required": ["city"]
      }
    }
  }
}
```

### FastAPI example

```
# FastAPI custom server (excerpt)
from fastapi import FastAPI
from pydantic import BaseModel, Field

app = FastAPI()

class WeatherRequest(BaseModel):
    class PathParams(BaseModel):
        city: str = Field(description="City name")

    class QueryParams(BaseModel):
        units: str = Field(default="metric", description="metric or imperial")

    path_params: PathParams
    query_params: QueryParams | None = None

@app.get("/info/")
async def metadata():
    return {
        # Custom model deployments expose custom server routes behind directAccess/.
        "endpoint": "directAccess/weather/{city}",
        "method": "GET",
        "input_schema": WeatherRequest.model_json_schema(),
    }

@app.get("/weather/{city}")
async def get_weather(city: str, units: str = "metric"):
    return {"city": city, "temp": 22, "units": units}
```

### Request mapping

Given this tool call:

```
{
  "path_params": {"city": "paris"},
  "query_params": {"units": "imperial"}
}
```

the MCP server generates a request like:

```
GET <base_url>/directAccess/weather/paris?units=imperial
```

Where:

- base_url is derived from the DataRobot deployment URL.
- directAccess/ is the prefix used for custom server endpoints in custom model deployments.

## Input schema reference

### Parameter groups

Parameters map to HTTP requests as follows:

| Group | Purpose | Example |
| --- | --- | --- |
| path_params | Substitutes values into the URL path. | {city} → "paris" |
| query_params | Adds query-string parameters. | ?units=imperial |
| data | Sends a raw request body, such as CSV. | Not used in the weather example. |
| json | Sends a JSON request body. | Not used in the weather example. |

### Rules

- path_params and query_params must be flat objects.
- data and json can contain nested structures.
- Every {param} in the endpoint must be present in path_params .
- Empty schemas are allowed only when MCP_SERVER_TOOL_REGISTRATION_ALLOW_EMPTY_SCHEMA=true .

### What the server does

Internally, the MCP server transforms tool calls into HTTP requests. For the weather example, the request looks like this:

```
async with session.request(
    method="GET",
    url="<base_url>/directAccess/weather/paris",
    params={"units": "imperial"},
) as response:
    return await response.json()
```

## Troubleshooting

### Tool does not register

Use these commands to inspect the deployment and, for DRUM or custom servers, test the `/info/` endpoint:

```
# Check that the deployment is active and tagged correctly.
curl -H "Authorization: Bearer $DATAROBOT_API_TOKEN" \
  "$DATAROBOT_ENDPOINT/api/v2/deployments/{deployment-id}/" | jq .

# Check the /info/ endpoint for DRUM and custom server deployments.
curl -H "Authorization: Bearer $DATAROBOT_API_TOKEN" \
  "$DATAROBOT_ENDPOINT/api/v2/deployments/{deployment-id}/directAccess/info/" | jq .
```

### Common errors

| Error | Fix |
| --- | --- |
| Missing input_schema | Add input_schema to the /info/ response for custom servers, or add inputSchema to model-metadata.yaml for DRUM unstructured models. |
| Unsupported top-level property | Use only path_params, query_params, data, and json. |
| Nested structure in path_params | Flatten the structure or move it to json. |
| Missing path parameter | Define every path variable from the endpoint in path_params. |

## Additional resources

- Integrate tools using an MCP server —connect MCP tools to agentic workflows.
- Connect agentic coding environments to MCP servers —configure Cursor, Claude Desktop, and VS Code.
- DataRobot MCP template —build and deploy standalone MCP servers.
- DataRobot Agentic Starter template —agentic application with MCP integration.
