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
| Name | Required | Description | Default |
|---|---|---|---|
| timestamp | Yes | The 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}` }], }; }
- src/server/handlers/listToolsHandler.ts:446-460 (registration)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>;