create_tag
Creates a tag within an organization for categorizing resources. Requires a unique name; color is optional.
Instructions
Create a tag.
Required fields: name. Optional: color.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/devhelm_mcp/tools/tags.py:36-44 (handler)Handler function that creates a tag by delegating to the SDK client's tags.create() method with the serialized body payload.
def create_tag(body: CreateTagRequest, api_token: str | None = None) -> ToolResult: """Create a tag. Required fields: name. Optional: color. """ try: return serialize(get_client(api_token).tags.create(as_payload(body))) except DevhelmError as e: raise_tool_error(e) - src/devhelm_mcp/tools/tags.py:6-6 (schema)Imports CreateTagRequest type from the devhelm SDK, which defines the input schema for create_tag (required: name, optional: color).
from devhelm.types import CreateTagRequest, UpdateTagRequest - src/devhelm_mcp/tools/tags.py:18-66 (registration)The register() function uses @mcp.tool() decorator to register create_tag (and sibling tag tools) with the FastMCP server.
def register(mcp: FastMCP) -> None: @mcp.tool() def list_tags(api_token: str | None = None) -> ToolResult: """List all tags in the workspace.""" try: return serialize(get_client(api_token).tags.list()) except DevhelmError as e: raise_tool_error(e) @mcp.tool() def get_tag(tag_id: str, api_token: str | None = None) -> ToolResult: """Get a tag by ID.""" try: return serialize(get_client(api_token).tags.get(tag_id)) except DevhelmError as e: raise_tool_error(e) @mcp.tool() def create_tag(body: CreateTagRequest, api_token: str | None = None) -> ToolResult: """Create a tag. Required fields: name. Optional: color. """ try: return serialize(get_client(api_token).tags.create(as_payload(body))) except DevhelmError as e: raise_tool_error(e) @mcp.tool() def update_tag( tag_id: str, body: UpdateTagRequest, api_token: str | None = None ) -> ToolResult: """Update a tag.""" try: return serialize( get_client(api_token).tags.update(tag_id, as_payload(body)) ) except DevhelmError as e: raise_tool_error(e) @mcp.tool() def delete_tag(tag_id: str, api_token: str | None = None) -> str: """Delete a tag.""" try: get_client(api_token).tags.delete(tag_id) return "Tag deleted successfully." except DevhelmError as e: raise_tool_error(e) - src/devhelm_mcp/server.py:109-110 (registration)Server-level registration that iterates over all tool modules (including tags) and calls their register() function to wire tools into the MCP server.
for mod in ALL_TOOL_MODULES: mod.register(mcp)