Skip to main content
Glama

tag_assets

Apply a tag to multiple assets to bulk-categorize photos. Use this to tag all vacation photos at once.

Instructions

Apply a tag to multiple assets at once. Use this to bulk-categorize photos (e.g. tag all vacation photos). Side effect: adds tag association to assets.

Args:
    tag_id: The tag UUID to apply (from list_tags or create_tag).
    asset_ids: List of asset UUIDs to tag. Must not be empty.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tag_idYes
asset_idsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for tag_assets — applies a tag to multiple assets, delegates to ImmichClient.tag_assets() for the HTTP request.
    @mcp.tool()
    async def tag_assets(ctx: Context, tag_id: str, asset_ids: list[str]) -> str:
        """Apply a tag to multiple assets at once. Use this to bulk-categorize photos
        (e.g. tag all vacation photos). Side effect: adds tag association to assets.
    
        Args:
            tag_id: The tag UUID to apply (from list_tags or create_tag).
            asset_ids: List of asset UUIDs to tag. Must not be empty.
    
        Returns: JSON with tag_id, count tagged, and per-asset results.
        """
        if not asset_ids:
            return json.dumps({"error": "asset_ids cannot be empty."})
        try:
            result = await _client(ctx).tag_assets(tag_id, asset_ids)
            return json.dumps({"tag_id": tag_id, "tagged": 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 @mcp.tool() decorator registers 'tag_assets' as an MCP tool on the FastMCP server instance.
    @mcp.tool()
    async def tag_assets(ctx: Context, tag_id: str, asset_ids: list[str]) -> str:
  • ImmichClient.tag_assets() — helper method that sends a PUT request to /tags/{tag_id}/assets with the asset IDs, performing the actual Immich API call to tag assets.
    async def tag_assets(self, tag_id: str, asset_ids: list[str]) -> list[dict]:
        """Add a tag to multiple assets."""
        return await self._request(
            "PUT", f"/tags/{tag_id}/assets", json={"ids": asset_ids}
        )
Behavior3/5

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

Mentions 'Side effect: adds tag association to assets' which is good, but lacks details on idempotency, error handling, or prerequisites. With no annotations, more behavioral context would be beneficial.

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?

Two sentences plus structured Args and Returns sections. No redundant information, every part is useful and front-loaded with purpose.

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?

Covers purpose, side effects, parameter details, and return format. Lacks error handling or limits, but for a straightforward bulk-operation tool, it is largely complete given the output schema exists.

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?

Schema coverage is 0%, but description includes a detailed Args section explaining each parameter's origin (tag_id from list_tags/create_tag) and constraints (asset_ids must not be empty), adding significant value.

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?

Description clearly states 'Apply a tag to multiple assets at once' with a specific verb and resource. It distinguishes from siblings like untag_assets and create_tag by noting bulk application.

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?

Provides a clear use case (bulk-categorize vacation photos) and lists required args. However, it does not explicitly discuss exclusions or when to use alternatives, though the context differentiates it from untag_assets.

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