Skip to main content
Glama

untag_assets

Remove a tag from multiple assets without deleting the tag. Specify tag ID and asset IDs to remove the tag-association.

Instructions

Remove a tag from multiple assets. The tag itself remains; only the association is removed. Side effect: removes tag-to-asset links.

Args:
    tag_id: The tag UUID to remove from assets.
    asset_ids: List of asset UUIDs to untag. Must not be empty.

Returns: JSON with tag_id, count untagged, and per-asset results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tag_idYes
asset_idsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'untag_assets'. Decorated with @mcp.tool(), it receives tag_id and asset_ids, validates non-empty, calls the client method, and returns JSON results.
    @mcp.tool()
    async def untag_assets(ctx: Context, tag_id: str, asset_ids: list[str]) -> str:
        """Remove a tag from multiple assets. The tag itself remains; only the association is
        removed. Side effect: removes tag-to-asset links.
    
        Args:
            tag_id: The tag UUID to remove from assets.
            asset_ids: List of asset UUIDs to untag. Must not be empty.
    
        Returns: JSON with tag_id, count untagged, and per-asset results.
        """
        if not asset_ids:
            return json.dumps({"error": "asset_ids cannot be empty."})
        try:
            result = await _client(ctx).untag_assets(tag_id, asset_ids)
            return json.dumps({"tag_id": tag_id, "untagged": len(asset_ids), "result": 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]})
  • The ImmichClient helper method that performs the actual API call: sends a DELETE request to /tags/{tag_id}/assets with the list of asset IDs.
    async def untag_assets(self, tag_id: str, asset_ids: list[str]) -> list[dict]:
        """Remove a tag from multiple assets."""
        return await self._request(
            "DELETE", f"/tags/{tag_id}/assets", json={"ids": asset_ids}
        )
  • The tool is registered via the @mcp.tool() decorator on the handler function in server.py. No separate registration file exists.
    @mcp.tool()
    async def untag_assets(ctx: Context, tag_id: str, asset_ids: list[str]) -> str:
        """Remove a tag from multiple assets. The tag itself remains; only the association is
        removed. Side effect: removes tag-to-asset links.
    
        Args:
            tag_id: The tag UUID to remove from assets.
            asset_ids: List of asset UUIDs to untag. Must not be empty.
    
        Returns: JSON with tag_id, count untagged, and per-asset results.
        """
        if not asset_ids:
            return json.dumps({"error": "asset_ids cannot be empty."})
        try:
            result = await _client(ctx).untag_assets(tag_id, asset_ids)
            return json.dumps({"tag_id": tag_id, "untagged": len(asset_ids), "result": 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]})
  • The input schema is defined by the function signature: tag_id (str) and asset_ids (list[str]). No separate schema file exists; the FastMCP framework derives the schema from type annotations.
    @mcp.tool()
    async def untag_assets(ctx: Context, tag_id: str, asset_ids: list[str]) -> str:
        """Remove a tag from multiple assets. The tag itself remains; only the association is
        removed. Side effect: removes tag-to-asset links.
    
        Args:
            tag_id: The tag UUID to remove from assets.
            asset_ids: List of asset UUIDs to untag. Must not be empty.
    
        Returns: JSON with tag_id, count untagged, and per-asset results.
        """
        if not asset_ids:
            return json.dumps({"error": "asset_ids cannot be empty."})
        try:
            result = await _client(ctx).untag_assets(tag_id, asset_ids)
            return json.dumps({"tag_id": tag_id, "untagged": len(asset_ids), "result": 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]})
Behavior4/5

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

The description clearly states the side effect (only removes association, not the tag) and the return structure (tag_id, count, per-asset results). It also notes the constraint that asset_ids must not be empty. With no annotations, it carries the full burden but omits permissions or error conditions.

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 two short paragraphs with clear separation for Args and Returns. Every sentence provides necessary information without redundancy.

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

Completeness4/5

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

The tool is simple and the description covers the core function, side effect, parameter constraints, and output shape. Given the output schema exists, the description is complete enough, though it could mention potential errors or rate limits for a higher score.

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

Parameters4/5

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

With 0% schema coverage, the description adds meaning: it specifies that tag_id is a UUID, asset_ids are UUIDs, and asset_ids must not be empty. This is more informative than the schema's type/title alone.

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 explicitly states the action 'Remove a tag from multiple assets', names the key resources (tag and assets), and distinguishes from sibling tools like 'delete_tag' (which deletes the tag itself) and 'tag_assets' (which adds the association).

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

Usage Guidelines3/5

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

The description implies usage (untagging many assets) but does not explicitly say when to choose this over alternatives, such as if a single asset needs untagging or if the tag should be deleted instead. No 'when-not' guidance is provided.

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