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
| Name | Required | Description | Default |
|---|---|---|---|
| link_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/immich_mcp_server/server.py:825-839 (handler)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}") - src/immich_mcp_server/server.py:825-839 (registration)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]})