Skip to main content
Glama

get_entity_history

Retrieve version history of entities from a knowledge graph memory system to track changes and analyze temporal data.

Instructions

Get the version history of an entity from your Memento MCP knowledge graph memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNameYesThe name of the entity to retrieve history for

Implementation Reference

  • MCP callTool handler for 'get_entity_history': invokes KnowledgeGraphManager.getEntityHistory(entityName) and returns JSON-formatted history or error message.
    case 'get_entity_history':
      try {
        const history = await knowledgeGraphManager.getEntityHistory(args.entityName);
        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 entity history: ${errorMessage}` }],
        };
      }
  • Tool registration in listToolsHandler: defines name, description, and input schema requiring 'entityName' string.
    {
      name: 'get_entity_history',
      description:
        'Get the version history of an entity from your Memento MCP knowledge graph memory',
      inputSchema: {
        type: 'object',
        properties: {
          entityName: {
            type: 'string',
            description: 'The name of the entity to retrieve history for',
          },
        },
        required: ['entityName'],
      },
    },
  • KnowledgeGraphManager wrapper: validates storageProvider support and delegates to storageProvider.getEntityHistory(entityName).
    async getEntityHistory(entityName: string): Promise<Entity[]> {
      if (!this.storageProvider || typeof this.storageProvider.getEntityHistory !== 'function') {
        throw new Error('Storage provider does not support entity history operations');
      }
    
      return this.storageProvider.getEntityHistory(entityName);
    }
  • Core implementation in Neo4jStorageProvider: Cypher query retrieves all Entity versions by name ordered by validFrom ASC, maps to Entity objects using nodeToEntity.
    async getEntityHistory(entityName: string): Promise<any[]> {
      try {
        // Query for entity history
        const query = `
          MATCH (e:Entity {name: $name})
          RETURN e
          ORDER BY e.validFrom ASC
        `;
    
        // Execute query
        const result = await this.connectionManager.executeQuery(query, { name: entityName });
    
        // Return empty array if no history found
        if (result.records.length === 0) {
          return [];
        }
    
        // Convert nodes to entities
        return result.records.map((record) => {
          const node = record.get('e').properties;
          return this.nodeToEntity(node);
        });
      } catch (error) {
        logger.error(`Error retrieving history for entity ${entityName} from Neo4j`, error);
        throw error;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While it indicates this is a read operation ('Get'), it doesn't describe what the version history includes (e.g., timestamps, changes), whether there are access restrictions, rate limits, or how results are structured. For a tool that retrieves historical data, this leaves significant behavioral gaps.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every word contributing to understanding what the tool does.

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 and the absence of both annotations and an output schema, the description is insufficient. It doesn't explain what the history includes, how it's formatted, or any behavioral aspects. For a tool that presumably returns structured historical data, this leaves too many unanswered questions about what to expect from the operation.

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?

The input schema has 100% description coverage, with the single parameter 'entityName' clearly documented. The description doesn't add any additional semantic context beyond what the schema provides, such as examples of entity names or format requirements. The baseline score of 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose with a specific verb ('Get') and resource ('version history of an entity'), and identifies the domain ('Memento MCP knowledge graph memory'). However, it doesn't explicitly distinguish this tool from sibling tools like 'get_relation_history' or 'get_graph_at_time', which also retrieve historical information but for different resources.

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. It doesn't mention when this tool is appropriate compared to similar historical retrieval tools like 'get_relation_history' or 'get_graph_at_time', nor does it specify any prerequisites or contextual constraints for its use.

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