get_relation
Retrieve enhanced properties of specific relationships between entities in a knowledge graph memory system for semantic analysis and data exploration.
Instructions
Get a specific relation with its enhanced properties from your Memento MCP knowledge graph memory
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | The name of the entity where the relation starts | |
| to | Yes | The name of the entity where the relation ends | |
| relationType | Yes | The type of the relation |
Implementation Reference
- The main handler logic for the 'get_relation' tool in the callToolHandler switch statement. It retrieves the relation using knowledgeGraphManager.getRelation and returns it as JSON or a not found message.case 'get_relation': const relation = await knowledgeGraphManager.getRelation( args.from, args.to, args.relationType ); if (!relation) { return { content: [ { type: 'text', text: `Relation not found: ${args.from} -> ${args.relationType} -> ${args.to}`, }, ], }; } return { content: [{ type: 'text', text: JSON.stringify(relation, null, 2) }] };
- src/server/handlers/listToolsHandler.ts:236-257 (registration)Registration of the 'get_relation' tool including its description and input schema in the listToolsHandler tools array.name: 'get_relation', description: 'Get a specific relation with its enhanced properties from your Memento MCP knowledge graph memory', inputSchema: { type: 'object', properties: { from: { type: 'string', description: 'The name of the entity where the relation starts', }, to: { type: 'string', description: 'The name of the entity where the relation ends', }, relationType: { type: 'string', description: 'The type of the relation', }, }, required: ['from', 'to', 'relationType'], }, },
- Input schema definition for the 'get_relation' tool.inputSchema: { type: 'object', properties: { from: { type: 'string', description: 'The name of the entity where the relation starts', }, to: { type: 'string', description: 'The name of the entity where the relation ends', }, relationType: { type: 'string', description: 'The type of the relation', }, }, required: ['from', 'to', 'relationType'], },