get_entity
Retrieve canonical entity by UUID, with optional inclusion of linked records such as source_records or links.
Instructions
Fetch an AnchorID (canonical entity) by UUID. Optionally include linked source records via the include parameter (links, source_records, or both).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | Yes | UUID of the AnchorID to retrieve | |
| include | No | Comma-separated relations to include: "links", "source_records", or both |
Implementation Reference
- src/tools.ts:228-237 (handler)The async handler function that executes the get_entity tool logic. It takes entity_id and optional include parameters, makes a GET request to /entities/{entity_id} via ApiClient, and returns the JSON response or an error.
async ({ entity_id, include }) => { try { const params: Record<string, string | undefined> = { include }; const data = await api.get(`/entities/${entity_id}`, params); return jsonContent(data); } catch (e) { return errorContent(e); } }, ); - src/tools.ts:219-227 (schema)Zod schema defining the input parameters for get_entity: entity_id (required UUID string) and include (optional string for comma-separated relations like 'links', 'source_records').
{ entity_id: z.string().describe("UUID of the AnchorID to retrieve"), include: z .string() .optional() .describe( 'Comma-separated relations to include: "links", "source_records", or both', ), }, - src/tools.ts:214-237 (registration)The get_entity tool is registered via server.tool() with the name 'get_entity', inside the registerTools() function which is exported from src/tools.ts and called in src/index.ts.
// ─── 5. get_entity ─────────────────────────────────────────────── server.tool( "get_entity", "Fetch an AnchorID (canonical entity) by UUID. Optionally include linked " + "source records via the include parameter (links, source_records, or both).", { entity_id: z.string().describe("UUID of the AnchorID to retrieve"), include: z .string() .optional() .describe( 'Comma-separated relations to include: "links", "source_records", or both', ), }, async ({ entity_id, include }) => { try { const params: Record<string, string | undefined> = { include }; const data = await api.get(`/entities/${entity_id}`, params); return jsonContent(data); } catch (e) { return errorContent(e); } }, );