Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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; } };
  • 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: [], }, };
  • 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(); }
  • 'read_graph' is listed in the expected tools array used for verification after auto-registration.
    'delete_relations', 'read_graph', 'search_nodes', 'open_nodes',

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/ali-48/rag-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server