Skip to main content
Glama

update_shared_link

Modify a shared link's permissions and expiry. Control download, upload, metadata visibility, or set expiration date; changes take effect immediately.

Instructions

Update a shared link's permissions or expiry. Use this to tighten/loosen access or set an expiration date. Side effect: changes public link behavior immediately.

Args:
    link_id: The shared link's UUID.
    allow_download: Allow visitors to download original files.
    show_metadata: Show EXIF data to visitors.
    allow_upload: Allow visitors to upload photos to the shared album.
    description: Link description. Empty string clears it.
    expiry_at: ISO 8601 expiry datetime. Empty string removes expiry (link never expires).

Returns: JSON with the updated shared link object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
link_idYes
allow_downloadNo
show_metadataNo
allow_uploadNo
descriptionNo
expiry_atNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for update_shared_link — builds a fields dict from optional parameters and delegates to ImmichClient.update_shared_link, with error handling.
    @mcp.tool()
    async def update_shared_link(
        ctx: Context,
        link_id: str,
        allow_download: bool | None = None,
        show_metadata: bool | None = None,
        allow_upload: bool | None = None,
        description: str | None = None,
        expiry_at: str | None = None,
    ) -> str:
        """Update a shared link's permissions or expiry. Use this to tighten/loosen access
        or set an expiration date. Side effect: changes public link behavior immediately.
    
        Args:
            link_id: The shared link's UUID.
            allow_download: Allow visitors to download original files.
            show_metadata: Show EXIF data to visitors.
            allow_upload: Allow visitors to upload photos to the shared album.
            description: Link description. Empty string clears it.
            expiry_at: ISO 8601 expiry datetime. Empty string removes expiry (link never expires).
    
        Returns: JSON with the updated shared link object.
        """
        fields: dict = {}
        if allow_download is not None:
            fields["allowDownload"] = allow_download
        if show_metadata is not None:
            fields["showMetadata"] = show_metadata
        if allow_upload is not None:
            fields["allowUpload"] = allow_upload
        if description is not None:
            fields["description"] = description  # empty string clears it
        if expiry_at is not None:
            fields["expiresAt"] = expiry_at if expiry_at else None  # empty string removes expiry
        if not fields:
            return json.dumps({"error": "No fields to update."})
        try:
            result = await _client(ctx).update_shared_link(link_id, **fields)
            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]})
  • The @mcp.tool() decorator registers this function as an MCP tool named 'update_shared_link'.
    @mcp.tool()
    async def update_shared_link(
        ctx: Context,
        link_id: str,
        allow_download: bool | None = None,
        show_metadata: bool | None = None,
        allow_upload: bool | None = None,
        description: str | None = None,
        expiry_at: str | None = None,
    ) -> str:
        """Update a shared link's permissions or expiry. Use this to tighten/loosen access
        or set an expiration date. Side effect: changes public link behavior immediately.
    
        Args:
            link_id: The shared link's UUID.
            allow_download: Allow visitors to download original files.
            show_metadata: Show EXIF data to visitors.
            allow_upload: Allow visitors to upload photos to the shared album.
            description: Link description. Empty string clears it.
            expiry_at: ISO 8601 expiry datetime. Empty string removes expiry (link never expires).
    
        Returns: JSON with the updated shared link object.
        """
        fields: dict = {}
        if allow_download is not None:
            fields["allowDownload"] = allow_download
        if show_metadata is not None:
            fields["showMetadata"] = show_metadata
        if allow_upload is not None:
            fields["allowUpload"] = allow_upload
        if description is not None:
            fields["description"] = description  # empty string clears it
        if expiry_at is not None:
            fields["expiresAt"] = expiry_at if expiry_at else None  # empty string removes expiry
        if not fields:
            return json.dumps({"error": "No fields to update."})
        try:
            result = await _client(ctx).update_shared_link(link_id, **fields)
            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]})
  • Client helper method that makes the actual PATCH /shared-links/{link_id} API call to Immich.
    async def update_shared_link(self, link_id: str, **fields) -> dict:
        """Update a shared link."""
        return await self._request("PATCH", f"/shared-links/{link_id}", json=fields)
Behavior3/5

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

The description mentions a side effect ('changes public link behavior immediately') but no annotations exist. It lacks disclosure on authorization needs or other behavioral traits, leaving some gaps.

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 concise and well-structured with a clear purpose, side effect note, and formatted Args/Returns sections. No unnecessary sentences.

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 output schema exists, description doesn't need to detail returns. It covers all 6 parameters, required field, and behavior, making it fully complete for the tool's complexity.

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?

With 0% schema description coverage, the description fully compensates by explaining each parameter, including edge cases like empty string clearing values and removing expiry, adding significant meaning beyond the schema.

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 it updates a shared link's permissions or expiry, using specific verb and resource. It distinguishes from related tools like create_shared_link and delete_shared_link.

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 explains when to use the tool ('to tighten/loosen access or set an expiration date') but does not explicitly state when not to use it or provide alternatives, though context from sibling tools implies those.

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