datarobot_genai.drmcputils.routes.tool_gallery
tool_gallery
/toolGallery/* — rich tool metadata routes for UIs, shared by both servers.
The first (and currently only) route is GET /toolGallery/tools/. The group is
designed to grow (e.g. /toolGallery/categories/), and every route under
/toolGallery is gated by the same predicate — see register_tool_gallery_routes.
The MCP tools/list response is intentionally lean: agents/LLMs never see the
UI-oriented fields (display_name, description_ui, auth_provider) — they
are stripped before FastMCP registration (see DRTOOLS_PRIVATE_METADATA_KEYS).
The tools route re-attaches them via an injected ui_metadata_provider (drtools'
get_tool_ui_metadata) — injected, not imported, because drmcputils may not import
drtools — and derives each tool's categories from the single-source-of-truth taxonomy.
It returns the full catalog (not the per-request filtered/CodeMode view), paginated via
limit/offset.
register_tool_gallery_routes
register_tool_gallery_routes(mcp: Any, base_path: str = _DEFAULT_BASE_PATH, gate: ToolGalleryGate | None = None, ui_metadata_provider: UiMetadataProvider | None = None) -> None
Register every /toolGallery/* route on the FastMCP server, all sharing gate.
tools is the first route (GET <base_path>/tools/). New gallery routes are
added in one place here and inherit the same gating automatically — the gate is
applied uniformly to the whole group rather than wired per route at the call site.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp
|
Any
|
FastMCP server instance. |
required |
base_path
|
str
|
Group prefix. Configurable so a mounted server (user-mcp) can prefix
it via |
_DEFAULT_BASE_PATH
|
gate
|
ToolGalleryGate | None
|
Optional async predicate |
None
|
ui_metadata_provider
|
UiMetadataProvider | None
|
Optional |
None
|