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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique numerical ID of the relationship in LittleSis database |
Implementation Reference
- src/tools/relationship-tools.ts:21-43 (handler)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 }; } }
- src/tools/relationship-tools.ts:5-18 (schema)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, ];
- src/api.ts:98-100 (helper)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>; }