get_entity_extensions
Retrieve entity type classifications and associated details for corporate influence tracking. Identify relationships between persons, organizations, and businesses to support accountability research.
Instructions
Get the types/extensions associated with an entity (Person, Organization, Business, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The entity ID | |
| details | No | Include additional details contained within extensions |
Implementation Reference
- src/tools/entity-tools.ts:229-251 (handler)The handler function that executes the tool logic: calls LittleSisApi.getEntityExtensions with id and details, formats the JSON response, and handles errors.export async function handleGetEntityExtensions(args: any) { try { const result = await LittleSisApi.getEntityExtensions(args.id, args.details); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching entity extensions: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/entity-tools.ts:67-85 (schema)Tool definition with input schema specifying required 'id' (number) and optional 'details' (boolean).export const getEntityExtensionsTool: Tool = { name: 'get_entity_extensions', description: 'Get the types/extensions associated with an entity (Person, Organization, Business, etc.)', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The entity ID' }, details: { type: 'boolean', description: 'Include additional details contained within extensions', default: false } }, required: ['id'] } };
- src/index.ts:72-81 (registration)Registration of tool handlers mapping 'get_entity_extensions' to handleGetEntityExtensions function, used by the CallToolRequestSchema handler.const toolHandlers = { get_entity: handleGetEntity, get_entities: handleGetEntities, search_entities: handleSearchEntities, get_entity_extensions: handleGetEntityExtensions, get_entity_relationships: handleGetEntityRelationships, get_entity_connections: handleGetEntityConnections, get_entity_lists: handleGetEntityLists, get_relationship: handleGetRelationship, };
- src/api.ts:67-70 (helper)API client method that performs the HTTP request to LittleSis API for entity extensions.static async getEntityExtensions(id: number, details: boolean = false): Promise<LittleSisApiResponse<Extension[]>> { const detailsParam = details ? '?details=TRUE' : ''; return makeApiRequest<Extension[]>(`/entities/${id}/extensions${detailsParam}`); }
- src/index.ts:58-69 (registration)Tool list registration including getEntityExtensionsTool for ListToolsRequestSchema.const tools = [ // Entity tools getEntityTool, getEntitesTool, searchEntitesTool, getEntityExtensionsTool, getEntityRelationshipsTool, getEntityConnectionsTool, getEntityListsTool, // Relationship tools getRelationshipTool, ];