get_duplicates
Fetch ML-detected duplicate photo groups to review and resolve duplicates in your Immich library. Read-only operation.
Instructions
Get all ML-detected duplicate asset groups. Use this to review potential duplicates before resolving them with resolve_duplicates. Requires Immich ML service. Read-only.
Returns: JSON array of duplicate groups (each with duplicateId, assets array, and similarity scores).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- MCP tool handler for get_duplicates. Calls the client method and returns JSON-serialized duplicate groups.
@mcp.tool() async def get_duplicates(ctx: Context) -> str: """Get all ML-detected duplicate asset groups. Use this to review potential duplicates before resolving them with resolve_duplicates. Requires Immich ML service. Read-only. Returns: JSON array of duplicate groups (each with duplicateId, assets array, and similarity scores). """ result = await _client(ctx).get_duplicates() return json.dumps(result, default=str) - Client helper method that makes the actual HTTP GET request to the Immich /duplicates API endpoint.
async def get_duplicates(self) -> list[dict]: """Get all detected duplicate groups.""" return await self._request("GET", "/duplicates")