Skip to main content
Glama
code-rabi

LittleSis MCP

by code-rabi

get_entity_relationships

Retrieve all relationships for a specific entity to analyze corporate connections and influence networks, with options to filter by category and sort by date or amount.

Instructions

Get all relationships this entity has with other entities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe entity ID
category_idNoFilter relationships by category (1-12)
sortNoSort order for relationshipsrecent
pageNoPage number for pagination

Implementation Reference

  • The handler function that executes the get_entity_relationships tool logic, calling the LittleSis API and returning formatted results or errors.
    export async function handleGetEntityRelationships(args: any) {
      try {
        const result = await LittleSisApi.getEntityRelationships(args.id, {
          category_id: args.category_id,
          sort: args.sort,
          page: args.page
        });
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching entity relationships: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • The Tool object definition including input schema and description for get_entity_relationships.
    export const getEntityRelationshipsTool: Tool = {
      name: 'get_entity_relationships',
      description: 'Get all relationships this entity has with other entities',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'number',
            description: 'The entity ID'
          },
          category_id: {
            type: 'number',
            description: 'Filter relationships by category (1-12)'
          },
          sort: {
            type: 'string',
            enum: ['amount', 'oldest', 'recent'],
            description: 'Sort order for relationships',
            default: 'recent'
          },
          page: {
            type: 'number',
            description: 'Page number for pagination',
            minimum: 1
          }
        },
        required: ['id']
      }
    };
  • src/index.ts:72-81 (registration)
    Registration of the get_entity_relationships handler in the toolHandlers mapping used by the MCP server.
    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,
    };
  • The LittleSisApi helper method that performs the actual API request for entity relationships.
    static async getEntityRelationships(id: number, params?: EntityRelationshipsParams): Promise<LittleSisApiResponse<Relationship[]>> {
      const searchParams = new URLSearchParams();
      if (params?.category_id) searchParams.append('category_id', params.category_id.toString());
      if (params?.sort) searchParams.append('sort', params.sort);
      if (params?.page) searchParams.append('page', params.page.toString());
      
      const paramString = searchParams.toString();
      const endpoint = `/entities/${id}/relationships${paramString ? '?' + paramString : ''}`;
      return makeApiRequest<Relationship[]>(endpoint);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets' relationships, implying a read operation, but doesn't mention whether this is paginated (though 'page' parameter hints at it), rate-limited, requires authentication, or what the return format looks like. For a tool with 4 parameters and no output schema, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like pagination behavior (implied by 'page' parameter), return format, or error conditions. For a read operation with multiple filtering/sorting options, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain what 'category_id' values 1-12 represent or clarify relationship semantics). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get all relationships') and target ('this entity has with other entities'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_entity_connections' or 'get_relationship', which appear to be related to entity relationships.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_entity_connections' or 'get_relationship'. There's no mention of prerequisites, exclusions, or comparative context with sibling tools, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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