Skip to main content
Glama

get_graph_at_time

Retrieve the state of a knowledge graph memory at a specific timestamp to analyze or restore its historical data efficiently.

Instructions

Get your Memento MCP knowledge graph memory as it existed at a specific point in time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timestampYesThe timestamp (in milliseconds since epoch) to query the graph at

Implementation Reference

  • Executes the get_graph_at_time tool by calling KnowledgeGraphManager.getGraphAtTime with the provided timestamp and returns the graph as JSON or an error message.
    case 'get_graph_at_time': try { const graph = await knowledgeGraphManager.getGraphAtTime(args.timestamp); return { content: [{ type: 'text', text: JSON.stringify(graph, null, 2) }] }; } catch (error: Error | unknown) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error retrieving graph at time: ${errorMessage}` }], }; }
  • Registers the get_graph_at_time tool in the listToolsHandler, including its name, description, and input schema requiring a 'timestamp' number.
    { name: 'get_graph_at_time', description: 'Get your Memento MCP knowledge graph memory as it existed at a specific point in time', inputSchema: { type: 'object', properties: { timestamp: { type: 'number', description: 'The timestamp (in milliseconds since epoch) to query the graph at', }, }, required: ['timestamp'], }, },
  • Helper method in KnowledgeGraphManager that delegates the getGraphAtTime call to the underlying storage provider if supported, throwing an error otherwise.
    async getGraphAtTime(timestamp: number): Promise<KnowledgeGraph> { if (!this.storageProvider || typeof this.storageProvider.getGraphAtTime !== 'function') { throw new Error('Storage provider does not support temporal graph operations'); } return this.storageProvider.getGraphAtTime(timestamp); }
  • Interface definition in StorageProvider for the optional getGraphAtTime method, specifying input timestamp and output KnowledgeGraph.
    getGraphAtTime?(timestamp: number): Promise<KnowledgeGraph>;

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