get_entity_export
Export the merged canonical view of all source records linked to an AnchorID as a single 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' MCP tool. Defines tool name, description, input schema (entity_id: UUID string), and delegates execution to the handler (callback).
// ─── 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-396 (handler)Handler for 'get_entity_export'. Calls api.get('/entities/${entity_id}/export') to fetch the golden record for an AnchorID, returning the merged/canonical view of all linked source records as JSON.
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)Input schema for 'get_entity_export' — requires a single parameter 'entity_id' (UUID string describing the AnchorID to export).
{ entity_id: z.string().describe("UUID of the AnchorID to export"), }, - src/tools.ts:18-22 (helper)Helper function jsonContent() — formats API response data as MCP tool content (text type with pretty-printed JSON).
function jsonContent(data: unknown) { return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }; } - src/tools.ts:25-42 (helper)Helper function errorContent() — formats errors as MCP tool content with isError flag, supporting ApiError with structured metadata (status_code, request_id, details).
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, }; }