get_tag
Retrieve detailed properties of a specific tag, including its name, color, and usage count, by providing its unique identifier.
Instructions
Get details for a specific tag. Use this to inspect a tag's properties. Read-only.
Args:
tag_id: The tag's UUID (from list_tags).
Returns: JSON with tag id, name, color, and usage count.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- MCP tool handler for 'get_tag'. Registered via @mcp.tool() decorator. Takes a tag_id, calls the client's get_tag method, and returns JSON with tag details.
@mcp.tool() async def get_tag(ctx: Context, tag_id: str) -> str: """Get details for a specific tag. Use this to inspect a tag's properties. Read-only. Args: tag_id: The tag's UUID (from list_tags). Returns: JSON with tag id, name, color, and usage count. """ try: result = await _client(ctx).get_tag(tag_id) return json.dumps(result, default=str) except httpx.HTTPStatusError as e: return json.dumps({"error": f"Immich API error: {e.response.status_code}", "detail": e.response.text[:200]}) - Helper method on ImmichClient that makes the actual HTTP GET request to /tags/{tag_id} to fetch tag details from the Immich API.
async def get_tag(self, tag_id: str) -> dict: """Get tag details.""" return await self._request("GET", f"/tags/{tag_id}") - src/immich_mcp_server/server.py:1129-1129 (registration)Registration of 'get_tag' as an MCP tool via the @mcp.tool() decorator on the FastMCP instance.
@mcp.tool()