Skip to main content
Glama
SiwarKhalfaoui

codegraph-mcp

Index a codebase

index_codebase

Parse a TypeScript/JavaScript codebase into call and import graphs using the TypeScript type checker. Run first to enable queries for definitions, callers, callees, and impact analysis.

Instructions

Parse a TypeScript/JavaScript codebase into a call graph and import graph, using the real TypeScript type checker for symbol resolution (not regex matching). Run this first before using any query tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
root_dirYesAbsolute path to the codebase root to index
graph_pathNoWhere to save the resulting graph (default: .codegraph/graph.json)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full transparency burden. It discloses a key behavioral trait: using the real TypeScript type checker rather than regex matching, which indicates accuracy. However, it does not mention side effects like writing a graph file (though implied by graph_path) or potential performance implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences, front-loaded with the core purpose and method. The usage guideline is placed at the end, but the entire text is efficient with no filler words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with only 2 params and no output schema, the description covers the essential purpose, methodology, and usage order. It doesn't explain the resulting graph's format or return behavior, but the schema's graph_path parameter already hints at the output file, and query tools are expected to consume it. Adequate for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% — both root_dir and graph_path have descriptions in the input schema. The tool description adds no additional semantic meaning beyond what the schema already provides, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool parses a TypeScript/JavaScript codebase into call and import graphs, with a specific verb ('Parse') and resource (codebase). It distinguishes itself from siblings by positioning it as the prerequisite step before query tools, which are all about querying existing graphs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Run this first before using any query tool,' providing clear usage context and ordering. It implies when not to use it (for answering queries) but does not name alternative tools explicitly; the sibling list makes that implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/SiwarKhalfaoui/codegraph-mcp'

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