Skip to main content
Glama

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
NameRequiredDescriptionDefault
fromYesThe name of the entity where the relation starts
toYesThe name of the entity where the relation ends
relationTypeYesThe 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) }] };
  • 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'], },

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/gannonh/memento-mcp'

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