get_entity_lists
Retrieve lists associated with an entity, such as Fortune 1000 or lobbying lists, using the entity ID. Enhance insights into corporate influence and accountability through LittleSis MCP.
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)The async handler function that executes the get_entity_lists tool: extracts entity ID from args, calls LittleSisApi.getEntityLists, formats response as JSON text content or error message.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 metadata definition including name 'get_entity_lists', description, and input schema that requires a numeric 'id' parameter.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)Server tool handlers registry mapping snake_case tool name 'get_entity_lists' to its handler function for execution during tool calls.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:93-95 (helper)LittleSisApi static method that performs HTTP request to fetch lists for a given entity ID from the /entities/{id}/lists endpoint.static async getEntityLists(id: number): Promise<LittleSisApiResponse<List[]>> { return makeApiRequest<List[]>(`/entities/${id}/lists`); }