Skip to main content
Glama

delete_shared_link

Revoke a shared link to immediately make the public URL inaccessible, while preserving the album and its photos. Removes the link permanently.

Instructions

Delete (revoke) a shared link, making the public URL immediately inaccessible. The album and its photos are unaffected. Side effect: permanently removes the link.

Args:
    link_id: The shared link's UUID to delete.

Returns: JSON with deleted confirmation and link_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
link_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'delete_shared_link'. Decorated with @mcp.tool(), it accepts a link_id, calls the client's delete_shared_link method, and returns a JSON confirmation or error.
    @mcp.tool()
    async def delete_shared_link(ctx: Context, link_id: str) -> str:
        """Delete (revoke) a shared link, making the public URL immediately inaccessible.
        The album and its photos are unaffected. Side effect: permanently removes the link.
    
        Args:
            link_id: The shared link's UUID to delete.
    
        Returns: JSON with deleted confirmation and link_id.
        """
        try:
            await _client(ctx).delete_shared_link(link_id)
            return json.dumps({"deleted": True, "link_id": link_id})
        except httpx.HTTPStatusError as e:
            return json.dumps({"error": f"Immich API error: {e.response.status_code}", "detail": e.response.text[:200]})
  • Client-side implementation of delete_shared_link. Sends a DELETE request to /shared-links/{link_id} on the Immich API.
    async def delete_shared_link(self, link_id: str) -> None:
        """Delete a shared link."""
        await self._request("DELETE", f"/shared-links/{link_id}")
  • The @mcp.tool() decorator on the delete_shared_link function registers it as an MCP tool with the FastMCP server.
    @mcp.tool()
    async def delete_shared_link(ctx: Context, link_id: str) -> str:
        """Delete (revoke) a shared link, making the public URL immediately inaccessible.
        The album and its photos are unaffected. Side effect: permanently removes the link.
    
        Args:
            link_id: The shared link's UUID to delete.
    
        Returns: JSON with deleted confirmation and link_id.
        """
        try:
            await _client(ctx).delete_shared_link(link_id)
            return json.dumps({"deleted": True, "link_id": link_id})
        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?

With no annotations, the description carries full burden. It discloses side effects (permanently removes the link), scope (album and photos unaffected), and immediate impact (URL inaccessible). It lacks info on error handling for invalid link_id but is sufficient.

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?

Every sentence contributes value: purpose, side effects, parameter description, return value. No redundancy or filler. Efficiently structured.

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 simple tool (one parameter) and presence of an output schema, the description covers all necessary aspects: action, side effects, parameter, and return. Nothing essential is missing.

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?

The schema has no descriptions (0% coverage), but the description adds 'The shared link's UUID to delete', explaining the parameter's purpose and format. This compensates well for the missing schema details.

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 action (delete/revoke a shared link) and the resource, with specific details like making the public URL immediately inaccessible. It distinguishes from sibling tools like create_shared_link or list_shared_links by its purpose.

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 implies when to use the tool (to revoke a link) without explicitly naming alternatives or stating when not to use it. The context of siblings provides differentiation.

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