datarobot_genai.drmcputils.tool_gallery
tool_gallery
Tool gallery utilities — shared between MCP servers and the ARD catalog.
This module has no fastmcp dependency and no MCP-protocol imports so it can be imported by drtools, drmcputils, and drmcpbase alike.
marked_kind
Return the gallery classification for a marker-classified tool, or None.
Source code in datarobot_genai/drmcputils/tool_gallery.py
is_hosted
Return True for dynamic/proxied tools — resolved at request time, not registered.
merge_tool_info
merge_tool_info(tool: Any, ui_metadata: dict[str, dict[str, Any]], scopes_provider: ScopesProvider | None = None) -> dict[str, Any]
Combine a FastMCP Tool with drtools UI metadata + derived categories.
Carries the raw tool_category marker and the tool's own description so the
builder can classify hosted tools (provider/categories) and fall back to the MCP
description when there is no curated UI copy.
Tags come from the drtools registry when available, preserving the declaration
order of @tool_metadata(tags=(...)). FastMCP stores tags as a set, so tools
outside the registry fall back to a sorted list — the only deterministic order a
set can offer.
required_scopes is read through scopes_provider so it covers every
declaration spelling and matches what the scope-validation middleware
enforces — never re-derived from any single mechanism here.
Source code in datarobot_genai/drmcputils/tool_gallery.py
build_tool_gallery_items
Build the tools-gallery JSON response items from merged tool dicts.
Each dict in tools should contain at minimum name and hosted.
All other keys are optional and fall back to safe defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tools
|
list[dict]
|
List of dicts with merged FastMCP tool attrs + drtools metadata. |
required |
Returns
Serialisable list of tool gallery item dicts.