datarobot_genai.drmcp.core.utils
utils
get_prompt_tags
Extract tags from a prompt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt
|
Prompt
|
MCP protocol Prompt |
required |
Returns
Set of tag strings, empty set if no tags found
Source code in datarobot_genai/drmcp/core/utils.py
get_resource_tags
Extract tags from a resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource
|
Resource
|
MCP protocol Resource |
required |
Returns
Set of tag strings, empty set if no tags found
Source code in datarobot_genai/drmcp/core/utils.py
get_tool_tags
Extract tags from a tool, handling both FastMCP Tool and MCP protocol Tool types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool
|
Tool | Tool
|
Either a FastMCP Tool or MCP protocol Tool |
required |
Returns
Set of tag strings, empty set if no tags found
Source code in datarobot_genai/drmcp/core/utils.py
filter_tools_by_tags
filter_tools_by_tags(*, tools: list[Tool | Tool], tags: list[str] | None = None, match_all: bool = False) -> list[Tool | MCPTool]
Filter tools by tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tools
|
list[Tool | Tool]
|
List of tools to filter |
required |
tags
|
list[str] | None
|
List of tags to filter by. If None, returns all tools |
None
|
match_all
|
bool
|
If True, tool must have all specified tags. If False, tool must have at least one tag. |
False
|
Returns
List of tools that match the tag criteria