read_graph
Access the complete knowledge graph memory system of Memento MCP to retrieve structured data with semantic search, temporal awareness, and relation management capabilities.
Instructions
Read the entire Memento MCP knowledge graph memory system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | No | Dummy parameter for no-parameter tools |
Implementation Reference
- The handleReadGraph function that executes the 'read_graph' tool logic by calling knowledgeGraphManager.readGraph() and formatting the result as a JSON text response.export async function handleReadGraph( args: Record<string, unknown>, // eslint-disable-next-line @typescript-eslint/no-explicit-any knowledgeGraphManager: any ): Promise<{ content: Array<{ type: string; text: string }> }> { const result = await knowledgeGraphManager.readGraph(); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- The schema definition and registration of the 'read_graph' tool in the listToolsHandler, including name, description, and input schema with a dummy parameter.{ name: 'read_graph', description: 'Read the entire Memento MCP knowledge graph memory system', inputSchema: { type: 'object', properties: { random_string: { type: 'string', description: 'Dummy parameter for no-parameter tools', }, }, }, },
- src/server/handlers/callToolHandler.ts:41-42 (registration)The dispatch case in handleCallToolRequest that registers and routes calls to the 'read_graph' handler.case 'read_graph': return await toolHandlers.handleReadGraph(args, knowledgeGraphManager);
- src/KnowledgeGraphManager.ts:892-894 (helper)The readGraph method in KnowledgeGraphManager, which loads and returns the entire knowledge graph (alias for loadGraph).async readGraph(): Promise<KnowledgeGraph> { return this.loadGraph(); }