Skip to main content
Glama

delete_tag

Remove a tag from all assets and permanently delete it from the library.

Instructions

Delete a tag and remove it from all assets. The assets themselves are unaffected. Side effect: permanently deletes the tag (cannot be undone).

Args:
    tag_id: The tag's UUID to delete.

Returns: JSON with deleted confirmation and tag_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tag_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler that defines and registers the 'delete_tag' tool. It receives tag_id from the client, calls the immich client's delete_tag method, and returns a JSON confirmation or error.
    @mcp.tool()
    async def delete_tag(ctx: Context, tag_id: str) -> str:
        """Delete a tag and remove it from all assets. The assets themselves are unaffected.
        Side effect: permanently deletes the tag (cannot be undone).
    
        Args:
            tag_id: The tag's UUID to delete.
    
        Returns: JSON with deleted confirmation and tag_id.
        """
        try:
            await _client(ctx).delete_tag(tag_id)
            return json.dumps({"deleted": True, "tag_id": tag_id})
        except httpx.HTTPStatusError as e:
            return json.dumps({"error": f"Immich API error: {e.response.status_code}", "detail": e.response.text[:200]})
  • The ImmichClient helper method that actually performs the HTTP DELETE request to the Immich API endpoint /tags/{tag_id}. This is the low-level API call.
    async def delete_tag(self, tag_id: str) -> None:
        """Delete a tag."""
        await self._request("DELETE", f"/tags/{tag_id}")
  • The tool is registered via the @mcp.tool() decorator on the delete_tag function in server.py. This is how the MCP framework discovers and exposes the tool.
    @mcp.tool()
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully discloses behavioral traits: permanent deletion, removal from all assets, and that assets themselves are unaffected. This is transparent and complete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences: first states action, second highlights side effect, third lists arguments and returns. Front-loaded with purpose, no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one required parameter, no nested objects), the description covers purpose, parameters, side effects, and return value completely. Output schema exists but is not needed for completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning beyond the input schema by specifying that tag_id is a UUID, which is not implied by the schema's string type. It also clearly documents the argument and return format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Delete' and resource 'tag', and distinguishes from sibling tools like create_tag, update_tag, and untag_assets by specifying that it removes the tag from all assets and deletes it permanently.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a side effect warning ('permanently deletes the tag (cannot be undone)'), which guides usage by emphasizing irreversibility. It lacks explicit alternatives but provides sufficient context for when to use the tool compared to other tag operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/drolosoft/immich-photo-manager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server