read_graph
Retrieve the complete knowledge graph structure to access indexed codebase relationships and semantic connections for analysis.
Instructions
Read the entire knowledge graph
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- build/tools/graph/read-graph.js:19-33 (handler)The handler function that implements the core logic of the 'read_graph' tool. It invokes knowledgeGraphManager.readGraph() and formats the entire knowledge graph as a JSON string in the MCP content format.export const readGraphHandler = async (args) => { try { const graph = await knowledgeGraphManager.readGraph(); return { content: [{ type: "text", text: JSON.stringify(graph, null, 2) }] }; } catch (error) { console.error("Error in read_graph tool:", error); throw error; } };
- build/tools/graph/read-graph.js:7-15 (schema)The tool definition object containing the name, description, and input schema (empty object since no parameters are required). This is used during registration.export const readGraphTool = { name: "read_graph", description: "Read the entire knowledge graph", inputSchema: { type: "object", properties: {}, required: [], }, };
- build/core/registry.js:136-150 (registration)The code block in the auto-registration logic that discovers and registers the tool by calling toolRegistry.register(tool, handler) for discovered Tool/Handler exports, including 'read_graph' from read-graph.js.for (const { tool, handler } of tools) { if (this.registeredTools.has(tool.name)) { if (this.config.verbose) { console.log(`⏭️ Outil déjà enregistré: ${tool.name}`); } continue; } try { toolRegistry.register(tool, handler); this.registeredTools.add(tool.name); registeredCount++; if (this.config.verbose) { console.log(`✅ Outil enregistré automatiquement: ${tool.name} (${path})`); } }
- The underlying helper method in KnowledgeGraphManager that loads and returns the entire knowledge graph from the memory file.async readGraph() { return this.loadGraph(); }
- build/core/registry.js:216-219 (registration)'read_graph' is listed in the expected tools array used for verification after auto-registration.'delete_relations', 'read_graph', 'search_nodes', 'open_nodes',