get_person_thumbnail
Retrieve a face crop thumbnail for a person to visually identify them before merging or renaming. Returns base64 image data.
Instructions
Get a base64-encoded face crop thumbnail for a person. Use this to visually identify a person before merging or renaming. Read-only.
Args:
person_id: The person's UUID.
Returns: JSON with 'data' (base64 string of face crop) and 'type' (MIME type).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| person_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/immich_mcp_server/server.py:973-984 (registration)MCP tool registration for get_person_thumbnail via @mcp.tool() decorator. Calls the client method and returns JSON.
@mcp.tool() async def get_person_thumbnail(ctx: Context, person_id: str) -> str: """Get a base64-encoded face crop thumbnail for a person. Use this to visually identify a person before merging or renaming. Read-only. Args: person_id: The person's UUID. Returns: JSON with 'data' (base64 string of face crop) and 'type' (MIME type). """ result = await _client(ctx).get_person_thumbnail(person_id) return json.dumps(result) - Input schema: person_id (string) and output: JSON with 'data' (base64 string) and 'type' (MIME type).
"""Get a base64-encoded face crop thumbnail for a person. Use this to visually identify a person before merging or renaming. Read-only. Args: person_id: The person's UUID. Returns: JSON with 'data' (base64 string of face crop) and 'type' (MIME type). """ - Core handler that makes the actual HTTP GET request to /api/people/{person_id}/thumbnail, returns base64-encoded image data.
async def get_person_thumbnail(self, person_id: str) -> dict: """Get a base64-encoded face thumbnail for a person.""" url = f"{self.base_url}/api/people/{person_id}/thumbnail" async with httpx.AsyncClient(timeout=30.0) as client: response = await client.get(url, headers=self._headers) response.raise_for_status() content_type = response.headers.get("content-type", "image/jpeg") b64 = base64.b64encode(response.content).decode("ascii") return {"data": b64, "type": content_type}