datarobot_genai.drtools.core.tool_metadata
tool_metadata
Tool metadata decorator for drtools.
This module provides a decorator that stores metadata about tools without creating any dependency on drmcp. The metadata can be discovered and used by drmcp to register the tools.
tool_metadata
Store tool metadata to a function without MCP registration.
Records the function and its metadata in a registry that drmcp discovers via
:func:get_registered_tools to register the tool. The function is returned
unchanged — no wrapper — so the registry and direct callers see the real
function (including its true coroutine-ness).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**metadata
|
Any
|
Keyword arguments for tool metadata (tags, name, description, etc.) |
{}
|
Returns
Decorator that registers the function and attaches its metadata, then
returns it unchanged.
Source code in datarobot_genai/drtools/core/tool_metadata.py
get_registered_tools
Get all registered tools and their metadata.
Returns
List of (function, metadata) tuples.
get_tool_ui_metadata
Build tool_name -> {display_name, description_ui, auth_provider} from the registry.
These UI-only keys are stripped before FastMCP registration (see
DRTOOLS_PRIVATE_METADATA_KEYS), so agents/LLMs never see them. The tools-gallery
route re-attaches them by calling this — it is injected into
register_tool_gallery_routes as the ui_metadata_provider because drmcputils
(where the route lives) may not import drtools. Owning this here keeps the metadata
keys with the registry that defines them.