get_entity_lists
Retrieve lists containing a specific entity, such as Fortune 1000 or lobbying registries, to track corporate affiliations and influence networks.
Instructions
Get the lists that an entity appears on (e.g., Fortune 1000, lobbying lists)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The entity ID |
Implementation Reference
- src/tools/entity-tools.ts:308-329 (handler)Handler function that executes the 'get_entity_lists' tool: calls LittleSisApi.getEntityLists with the provided entity ID, formats the JSON response, and handles errors.export async function handleGetEntityLists(args: any) { try { const result = await LittleSisApi.getEntityLists(args.id); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching entity lists: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; }
- src/tools/entity-tools.ts:141-154 (schema)Tool schema definition for 'get_entity_lists', specifying input as an object with required 'id' number property.export const getEntityListsTool: Tool = { name: 'get_entity_lists', description: 'Get the lists that an entity appears on (e.g., Fortune 1000, lobbying lists)', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The entity ID' } }, required: ['id'] } };
- src/index.ts:72-81 (registration)Registration of tool handlers in the mapping object used by CallToolRequestSchema handler to dispatch 'get_entity_lists' to handleGetEntityLists.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/index.ts:58-69 (registration)Registration of tool specifications in the tools array returned by ListToolsRequestSchema handler, including getEntityListsTool.const tools = [ // Entity tools getEntityTool, getEntitesTool, searchEntitesTool, getEntityExtensionsTool, getEntityRelationshipsTool, getEntityConnectionsTool, getEntityListsTool, // Relationship tools getRelationshipTool, ];
- src/api.ts:93-95 (helper)API helper method called by the handler to fetch entity lists from LittleSis API endpoint /entities/{id}/lists.static async getEntityLists(id: number): Promise<LittleSisApiResponse<List[]>> { return makeApiRequest<List[]>(`/entities/${id}/lists`); }