get_entity_export
Export the canonical golden record for a specific AnchorID to retrieve merged identity data from all linked source records as a unified JSON object.
Instructions
Export the golden record for an AnchorID. Returns the merged/canonical view of all linked source records as a single JSON object.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | Yes | UUID of the AnchorID to export |
Implementation Reference
- src/tools.ts:380-396 (registration)Registration of the 'get_entity_export' tool using server.tool() with name, description, Zod schema, and inline handler function
// ─── 11. get_entity_export ────────────────────────────────────── server.tool( "get_entity_export", "Export the golden record for an AnchorID. Returns the merged/canonical " + "view of all linked source records as a single JSON object.", { entity_id: z.string().describe("UUID of the AnchorID to export"), }, async ({ entity_id }) => { try { const data = await api.get(`/entities/${entity_id}/export`); return jsonContent(data); } catch (e) { return errorContent(e); } }, ); - src/tools.ts:388-395 (handler)Inline handler function for 'get_entity_export' that calls the API endpoint /entities/{entity_id}/export and returns formatted JSON content
async ({ entity_id }) => { try { const data = await api.get(`/entities/${entity_id}/export`); return jsonContent(data); } catch (e) { return errorContent(e); } }, - src/tools.ts:385-387 (schema)Zod schema definition for the 'get_entity_export' tool input parameter - entity_id as a UUID string
{ entity_id: z.string().describe("UUID of the AnchorID to export"), }, - src/tools.ts:17-42 (helper)Helper functions jsonContent and errorContent used by the tool handler to format API responses and errors as MCP tool content
/** Format the API response as MCP tool content. */ function jsonContent(data: unknown) { return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }; } /** Format an error as MCP tool content (isError flag). */ function errorContent(err: unknown) { if (err instanceof ApiError) { const payload = { error: err.message, status_code: err.status_code, request_id: err.request_id, details: err.details, }; return { content: [{ type: "text" as const, text: JSON.stringify(payload, null, 2) }], isError: true, }; } return { content: [{ type: "text" as const, text: (err as Error).message ?? String(err) }], isError: true, }; }