Skip to main content
Glama

get_relationship

Retrieve detailed information about connections between entities to analyze corporate influence and accountability.

Instructions

Get detailed information about a specific relationship between two entities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique numerical ID of the relationship in LittleSis database

Implementation Reference

  • The handler function that implements the core logic of the 'get_relationship' tool. It calls the LittleSisApi.getRelationship method and formats the response as MCP tool content, handling errors appropriately.
    export async function handleGetRelationship(args: any) { try { const result = await LittleSisApi.getRelationship(args.id); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching relationship: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
  • The tool specification including the input schema that defines the expected arguments (relationship ID) for the 'get_relationship' tool.
    export const getRelationshipTool: Tool = { name: 'get_relationship', description: 'Get detailed information about a specific relationship between two entities', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The unique numerical ID of the relationship in LittleSis database' } }, required: ['id'] } };
  • src/index.ts:72-81 (registration)
    Registration of the tool handler mapping, associating 'get_relationship' with handleGetRelationship function.
    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:67-69 (registration)
    Registration of the tool in the list of available tools returned by ListToolsRequest.
    // Relationship tools getRelationshipTool, ];
  • Helper method in LittleSisApi class that makes the actual API request to fetch relationship data from LittleSis.
    static async getRelationship(id: number): Promise<RelationshipWithEntities> { return makeApiRequest<Relationship>(`/relationships/${id}`) as Promise<RelationshipWithEntities>; }

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