Dynamic tool registration¶
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 and the DataRobot Agentic Starter template. For MCP server setup and agent integration, see Integrate tools using an MCP server.
クイックスタート¶
- Deploy your model or service to DataRobot.
- Tag the deployment with
toolas both the tag name and the tag value. - 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¶
| デプロイのタイプ | 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
toolas both the name and value.
Additional requirements depend on the deployment type:
- DataRobot native models: No extra requirements.
- DRUM unstructured models: Define
inputSchemainmodel-metadata.yaml. - Custom servers: Expose
/info/and returnendpoint,method, andinput_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:
@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 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:
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
Unstructured model schemas
- For unstructured models, define request parameters under the
jsonproperty. - Exposing input schemas from
model-metadata.yamlrequiresdatarobot-drumversion1.17.2or later.
Optional custom schema¶
You can override fallback schemas to give the LLM better guidance or tighter control over the request shape:
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¶
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
各パラメーターについて説明します。
base_urlis 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:
| グループ | 目的 | 例 |
|---|---|---|
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. |
ルール¶
path_paramsandquery_paramsmust be flat objects.dataandjsoncan contain nested structures.- Every
{param}in the endpoint must be present inpath_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()
トラブルシューティング¶
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¶
| エラー | 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. |
その他のリソース¶
- 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.