Skip to main content
Glama

get_entity_connections

Explore and retrieve entities connected to a specified entity via relationships. Filter connections by category and use pagination to manage large datasets. Ideal for analyzing corporate influence and accountability on the LittleSis MCP server.

Instructions

Get other entities that this entity has relationships with

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
category_idNoFilter connections by relationship category
idYesThe entity ID
pageNoPage number for pagination

Implementation Reference

  • Handler function that executes the get_entity_connections tool logic by calling LittleSisApi.getEntityConnections and formatting the response as MCP content.
    export async function handleGetEntityConnections(args: any) { try { const result = await LittleSisApi.getEntityConnections(args.id, { category_id: args.category_id, page: args.page }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching entity connections: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
  • Tool schema definition including input validation for the get_entity_connections tool.
    export const getEntityConnectionsTool: Tool = { name: 'get_entity_connections', description: 'Get other entities that this entity has relationships with', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The entity ID' }, category_id: { type: 'number', description: 'Filter connections by relationship category' }, page: { type: 'number', description: 'Page number for pagination', minimum: 1 } }, required: ['id'] } };
  • src/index.ts:72-81 (registration)
    Registration of the tool handler in the main server for handling CallTool requests.
    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, };
  • API client method that fetches entity connections from LittleSis API, called by the tool handler.
    static async getEntityConnections(id: number, params?: EntityConnectionsParams): Promise<LittleSisApiResponse<Entity[]>> { const searchParams = new URLSearchParams(); if (params?.category_id) searchParams.append('category_id', params.category_id.toString()); if (params?.page) searchParams.append('page', params.page.toString()); const paramString = searchParams.toString(); const endpoint = `/entities/${id}/connections${paramString ? '?' + paramString : ''}`; return makeApiRequest<Entity[]>(endpoint); }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/code-rabi/littlesis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server