Skip to main content
Glama

get_relation_history

Retrieve version history for relationships between entities in a knowledge graph, tracking changes over time to understand connection evolution.

Instructions

Get the version history of a relation 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

  • Handler logic in the main callToolHandler switch statement that extracts parameters (from, to, relationType) from the tool arguments, calls knowledgeGraphManager.getRelationHistory, and returns the JSON-formatted history or error message.
    case 'get_relation_history':
      try {
        const history = await knowledgeGraphManager.getRelationHistory(
          args.from,
          args.to,
          args.relationType
        );
        return { content: [{ type: 'text', text: JSON.stringify(history, null, 2) }] };
      } catch (error: Error | unknown) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [{ type: 'text', text: `Error retrieving relation history: ${errorMessage}` }],
        };
      }
  • Tool registration in the temporalTools array, including name, description, and inputSchema defining the required parameters (from, to, relationType). This makes the tool available via listTools.
    {
      name: 'get_relation_history',
      description:
        'Get the version history of a relation 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_history tool, specifying object with properties from, to, relationType (all strings, required).
    {
      name: 'get_relation_history',
      description:
        'Get the version history of a relation 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'],
      },
    },
  • Core helper method in KnowledgeGraphManager that checks for storageProvider support and delegates the getRelationHistory call to it, throwing an error if not supported.
    async getRelationHistory(from: string, to: string, relationType: string): Promise<Relation[]> {
      if (!this.storageProvider || typeof this.storageProvider.getRelationHistory !== 'function') {
        throw new Error('Storage provider does not support relation history operations');
      }
    
      return this.storageProvider.getRelationHistory(from, to, relationType);
    }
  • Interface definition for the optional getRelationHistory method in StorageProvider, specifying parameters and return type (Promise<any[]>).
    getRelationHistory?(from: string, to: string, relationType: string): Promise<any[]>;
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. While 'Get the version history' implies a read-only operation, it doesn't specify whether this requires authentication, what format the history returns (e.g., timestamps, changes), or any rate limits. The description is minimal and lacks crucial behavioral context for a tool that presumably returns historical data.

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 that communicates the core purpose without unnecessary words. It's appropriately sized for a tool with three parameters and no complex behavioral nuances to explain, making every word earn its place.

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 complexity of retrieving version history from a knowledge graph, the description is insufficient. With no annotations and no output schema, it doesn't explain what the history includes (e.g., timestamps, previous values, who made changes) or how results are structured. For a tool that presumably returns temporal data, this leaves significant gaps in understanding.

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 already documents all three parameters (from, to, relationType) with clear descriptions. The description adds no additional parameter information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter documentation.

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 the version history') and resource ('of a relation from your Memento MCP knowledge graph memory'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_entity_history' or 'get_relation', which offer related but distinct functionality.

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_relation' (which might retrieve current state) or 'get_entity_history' (which focuses on entities rather than relations). There's no mention of prerequisites, timing considerations, or comparison with sibling tools.

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

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