get_entity
Retrieve detailed information about a person or organization using its unique ID from the LittleSis database to track corporate influence and accountability.
Instructions
Get detailed information about a specific entity (person or organization) from LittleSis by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique numerical ID of the entity in LittleSis database |
Implementation Reference
- src/tools/entity-tools.ts:157-179 (handler)Handler function that executes the get_entity tool: calls LittleSisApi.getEntity with the provided id and returns formatted JSON response or error.export async function handleGetEntity(args: any) { try { const result = await LittleSisApi.getEntity(args.id); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching entity: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/entity-tools.ts:5-18 (schema)Input schema and metadata definition for the get_entity tool, specifying required 'id' parameter.export const getEntityTool: Tool = { name: 'get_entity', description: 'Get detailed information about a specific entity (person or organization) from LittleSis by ID', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The unique numerical ID of the entity in LittleSis database' } }, required: ['id'] } };
- src/index.ts:72-81 (registration)Registration of the get_entity tool handler in the MCP server's toolHandlers map, used by 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:46-48 (helper)LittleSisApi helper method that makes the actual API request to fetch entity by ID, called by the tool handler.static async getEntity(id: number): Promise<LittleSisApiResponse<Entity>> { return makeApiRequest<Entity>(`/entities/${id}`); }