CRAG-MCP
Analyzes and queries code graphs from Linux kernel or other C projects, respecting conditional compilation (#ifdef) based on kernel config files like .config.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CRAG-MCPshow wifi p2p flow with WIFI_P2P_SUPPORT=y"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CRAG-MCP: Config-Aware Code Graph via MCP
程式碼 graph 建構與查詢 MCP Server,支援條件編譯(#ifdef)動態過濾。 每個 workspace 獨立儲存 graph + config,支援多專案比較。
核心概念:Config-Aware Graph
傳統 Graph:
cfg80211_p2p_init() ──→ cfg80211_get_bss()
(不知道這個 function 需要什麼條件才能存在)
CRAG Graph:
cfg80211_p2p_init()
active_conditions: {"WIFI_P2P_SUPPORT": "y"}
──→ cfg80211_get_bss()
Query: preprocess_config({"WIFI_P2P_SUPPORT": "n"})
Result: cfg80211_p2p_init() 被自動過濾掉
Query: preprocess_config({"WIFI_P2P_SUPPORT": "y"})
Result: cfg80211_p2p_init() 出現Related MCP server: CodeAnalysis MCP Server
架構
crag-mcp/
├── crag_mcp/
│ ├── core/
│ │ ├── workspace.py # Workspace 掃描
│ │ └── config_context.py # Config / #ifdef 管理
│ ├── parsers/
│ │ └── tree_sitter_parser.py # AST + #ifdef 條件提取
│ ├── llm/
│ │ └── small_llm.py # Semantic analysis
│ ├── graph/
│ │ └── kuzu_graph.py # Kùzu + active_conditions
│ └── server/
│ └── mcp_server.py # 7 tools
├── pyproject.toml
└── README.mdMCP Tools (7)
Tool | 用途 |
| 設定 workspace 與 LLM |
| 載入條件編譯設定(綁定 workspace) |
| 搜尋(自動套用 config 過濾) |
| Graph: upstream(config-aware) |
| Graph: downstream(config-aware) |
| Graph: path(config-aware) |
| Graph 狀態 |
所有查詢 tool 都接受
workspace_path參數,指向要操作的 workspace。 不傳則用最後一次configure()設定的 workspace。
Atomic 設計哲學
每個 workspace 完全獨立,各自擁有自己的:
/ws/A/.crag-mcp/
├── graph.kuzu/ # Kùzu DB(函式 + 呼叫關係)
└── file_cache/ # parse cachequery_graph(ws=A)只查 A 的 DB、只套 A 的 configquery_graph(ws=B)只查 B 的 DB、只套 B 的 config兩者完全不會互相干擾
Agent(或 LLM)負責 orchestration — 輪流查不同 workspace,再自行比較結果。
使用流程
1. 一般專案(無 #ifdef)
configure(workspace_path="/path/to/project")
query_graph("authentication flow")
# 無條件過濾,所有 code 都出現2. C / Linux Kernel(有 #ifdef)
configure(workspace_path="/path/to/linux")
preprocess_config(
config_path="/path/to/linux/.config",
define_overrides={"WIFI_P2P_SUPPORT": "y"}
)
query_graph("WIFI P2P implementation")
# 只有 WIFI_P2P_SUPPORT=y 的 code 會出現
# 改 config,重新查詢
preprocess_config(
config_path="/path/to/linux/.config",
define_overrides={"WIFI_P2P_SUPPORT": "n"}
)
query_graph("WIFI P2P implementation")
# P2P 相關 code 被自動過濾掉3. 多 Workspace 比較(Agent 層次)
configure(workspace_path="/ws/A")
preprocess_config(config_path="/ws/A/.config", workspace_path="/ws/A")
configure(workspace_path="/ws/B")
preprocess_config(config_path="/ws/B/.config", workspace_path="/ws/B")
result_a = query_graph("wifi p2p flow", workspace_path="/ws/A")
result_b = query_graph("wifi p2p flow", workspace_path="/ws/B")
# Agent 自行比較,再決定要不要查 C
result_c = query_graph("wifi p2p flow", workspace_path="/ws/C")preprocess_config 支援的格式
格式 | 範例 | 說明 |
Linux .config |
| 自動 parse |
C Header |
|
|
Makefile |
|
|
JSON |
| 直接載入 |
Manual |
| 程式設定 |
Config 過濾邏輯
# Graph node 儲存
{
"name": "cfg80211_p2p_init",
"active_conditions": {"WIFI_P2P_SUPPORT": "y"}
}
# Query 時比對
preprocess_config(define_overrides={"WIFI_P2P_SUPPORT": "n"})
# → cfg80211_p2p_init 被過濾(條件不滿足)
preprocess_config(define_overrides={"WIFI_P2P_SUPPORT": "y"})
# → cfg80211_p2p_init 出現(條件滿足)
# 無 active_conditions → 永遠出現(always active)本地儲存位置
每個 workspace 會在自己的根目錄下建立 .crag-mcp/ 目錄:
/path/to/project/.crag-mcp/
├── graph.kuzu/ # Kùzu DB(二進制目錄)
└── file_cache/ # parse cache(JSON)加到 .gitignore:
.crag-mcp/安裝
cd /path/to/crag-mcp/
pip install -e .或使用 uv:
cd /path/to/crag-mcp/
uv pip install -e .OpenCode 設定
{
"mcpServers": {
"crag": {
"command": "uv",
"args": ["run", "--directory", "/path/to/crag-mcp", "-m", "crag_mcp.server.mcp_server"],
"env": {
"CRAG_WORKSPACE": "${workspaceFolder}",
"CRAG_SMALL_LLM": "gemma4:31b-cloud"
}
}
}
}Agent 決策流程
Agent 看到專案:
├── 有 .config / Kconfig / #ifdef → 呼叫 preprocess_config()
├── 純 Python / JS / Go → 不呼叫(無條件編譯)
└── 使用者提到 "kernel" / "config" → 詢問是否 preprocessToken 節省
場景 | 傳統 | CRAG-MCP |
Kernel query | 餵全部 code(含 dead code) | 只查 active code |
Config 切換 | 重新 index 整個 repo | 只改 query 條件 |
#ifdef 分析 | LLM 自己猜條件 | graph 標記清楚 |
License
MIT
Available Tools
9 toolsconfigureC
Configure workspace and LLM.
| Name | Required | Description | Default |
|---|---|---|---|
| llm_endpoint | No | ||
| workspace_path | No | ||
| small_llm_model | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits. It only says 'Configure workspace and LLM' without indicating whether this modifies state, requires permissions, or has side effects. Insufficient for a configure operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise (3 words), but lacks substance. It is not bloated, but the brevity sacrifices clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having an output schema, the description provides no context about the tool's effect (e.g., persistent config vs temporary) or expected usage. Incomplete for a configuration tool with no annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description adds no explanation of the three parameters (llm_endpoint, workspace_path, small_llm_model). An agent cannot infer parameter details from the description alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states verb 'Configure' and resources 'workspace' and 'LLM', clearly identifying the tool's purpose. It distinguishes from siblings that have specific operations like preprocess_config or query_graph, but does not explicitly differentiate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like preprocess_config. No context on prerequisites or typical usage flow.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_calleesB
Find functions called by the given function.
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Call depth (default: 1) | |
| function_name | Yes | Function name to look up | |
| workspace_path | No | Target workspace (default: last configured) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry full burden. It only states the basic function and does not disclose behavioral traits such as read-only nature, required permissions, or any side effects. The description is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (5 words) and front-loaded with the core purpose. It avoids fluff but is perhaps too terse, lacking necessary context. Still, it is efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and the presence of an output schema, the minimal description covers the basic purpose. However, it omits any contextual details about handling depth or workspace, making it adequate but not complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description does not add meaning beyond the schema for parameters like depth or workspace_path. It covers function_name implicitly but adds no extra details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Find functions called by the given function,' specifying the verb (find) and resource (functions called). It effectively distinguishes from sibling tools like get_callers (which finds callers) and get_call_path (path).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. There is no mention of context, prerequisites, or when not to use it. With multiple sibling tools, the agent lacks direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_callersC
Find functions that call the given function.
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Call depth (default: 1) | |
| function_name | Yes | Function name to look up | |
| workspace_path | No | Target workspace (default: last configured) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does not disclose behavioral traits such as whether the operation is read-only, how depth affects results, or any authorization requirements. The description adds no value beyond the basic operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, which is concise. However, it may be too brief to be fully informative, but the conciseness itself is good.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists (not shown), so return values need not be explained. However, the description does not clarify the depth parameter's effect or workspace scope behavior. It is adequate but has gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, meaning all three parameters (depth, function_name, workspace_path) are described in the input schema itself. The description adds no additional meaning beyond the schema, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Find functions that call the given function' clearly states the tool's purpose with a specific verb and resource. However, it does not differentiate from sibling tools like 'get_callees' (which finds called functions) or 'get_call_path', so it lacks sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives, prerequisites, or limitations. The description is too brief to help the agent decide between this and similar tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_call_pathA
Find call path between two functions using BFS.
Requires call edges in the graph (populated by summarize_function()).
| Name | Required | Description | Default |
|---|---|---|---|
| max_depth | No | Maximum search depth (default: 10, max: 100) | |
| to_function | Yes | Target function | |
| from_function | Yes | Start function | |
| workspace_path | No | Target workspace (default: last configured) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden. It mentions BFS and the max_depth parameter, but does not disclose whether the operation is read-only, what happens if no path exists, or error handling. This is adequate but could be more transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no fluff: first sentence states core purpose, second gives a crucial prerequisite. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (pathfinding with BFS, prerequisite state), the description covers the key context. It lacks details on what happens if no path is found or if workspace_path is needed, but the output schema likely covers return values. Slightly incomplete but mostly sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds no additional parameter-level detail beyond what the schema provides (e.g., max_depth default and max are already in schema). It does not enhance parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool finds a call path between two functions using BFS, which is a specific verb-resource combination. It distinguishes itself from siblings like get_callers/get_callees by focusing on paths rather than direct calls.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states the prerequisite (call edges populated by summarize_function()), providing clear context for when to use. It does not explicitly mention when not to use or list alternative tools, but the purpose is distinct.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
graph_statsC
Get graph statistics for a workspace.
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_path | No | Target workspace (default: last configured) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the full burden. It only states 'get graph statistics' without disclosing whether it is a read-only operation, requires authentication, or any side effects. This is insufficient for a tool with no structured behavioral hints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words. However, it is overly sparse and could include more context without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's name and the presence of an output schema, the description should clarify what 'graph statistics' include (e.g., nodes, edges, metrics). It lacks completeness for a tool with one parameter and no sibling differentiation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already describes the parameter with 100% coverage, including a description. The tool description adds no additional meaning beyond what the schema provides, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it gets graph statistics for a workspace, using a specific verb and resource. However, it does not differentiate from sibling tools like query_graph or get_callers, which could overlap in purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description implies usage when graph statistics are needed, but offers no exclusions or context about preferred scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
preprocess_configA
Load preprocessing config for conditional compilation.
Call this when analyzing C/C++ projects with #ifdef blocks, Linux kernel with Kconfig, or Makefile-based builds.
Supports:
Linux .config files
C header files with #define
Makefiles with CFLAGS -D
JSON files
Manual define overrides
| Name | Required | Description | Default |
|---|---|---|---|
| config_path | No | Path to config file (.config, .h, Makefile, .json) | |
| workspace_path | No | Target workspace (default: last configured) | |
| define_overrides | No | Extra defines {name: value} (e.g., {"WIFI_P2P": "y"}) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility for behavioral disclosure. It does not mention side effects, return value (despite output schema existing), idempotency, or required permissions. It focuses only on what the tool does, not how it behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise: two sentences and a bullet list. It front-loads the primary purpose and then provides supporting details in an organized list. Every sentence adds value, with no redundant or filler content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers tool purpose, usage context, and parameter details well. However, it omits any mention of the return value or side effects. Since an output schema exists, the description could be more complete by referencing what the tool returns, but it is still effective for selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, the baseline is 3. The description adds meaningful context beyond the schema by listing supported file formats (e.g., .config, .h, Makefile, JSON) and explaining when to use manual define overrides. This enriches parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool loads preprocessing config for conditional compilation, with specific verb 'load' and resource 'preprocessing config'. It distinguishes from siblings like 'configure' by targeting use cases for C/C++ #ifdef blocks, Linux Kconfig, and Makefile-based builds.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to call ('when analyzing C/C++ projects with #ifdef blocks, Linux kernel with Kconfig, or Makefile-based builds') and lists supported file types. However, it does not provide explicit exclusions or alternative tools, which would earn a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_graphA
Search code graph. Automatically indexes relevant files.
If preprocess_config() was called on the workspace, filters by active defines. Otherwise returns all functions (no filtering).
Parses source files into the graph with AST (no LLM). Use summarize_function() on individual results for deep analysis.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query | |
| max_results | No | Max results to return (default: 10) | |
| workspace_path | No | Target workspace (default: last configured) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses automatic indexing, AST-based parsing (no LLM), filtering logic, and fallback behavior. With no annotations, this fully covers behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Very concise (4 sentences), front-loaded with purpose, and every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity, schema coverage, and presence of output schema, the description covers key aspects: filtering, indexing, no-LLM, and referral to sibling for deep analysis.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so description adds no new param details. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Search code graph' as verb+resource, and differentiates from sibling tools by explaining filtering behavior and suggesting summarize_function for deeper analysis.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides context on when filtering applies (if preprocess_config was called) and directs to summarize_function for deeper analysis, but does not explicitly state when to use other siblings like get_callers or get_callees.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_function_bodyB
Read the full source code of a function.
| Name | Required | Description | Default |
|---|---|---|---|
| function_name | Yes | Name of the function | |
| workspace_path | No | Target workspace (default: last configured) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The verb 'Read' implies a non-destructive operation, which is the primary behavioral trait. However, with no annotations, the description does not disclose other traits like caching, permissions, or error handling. The output schema mitigates some need for return format details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no extraneous words. It is front-loaded, but could include more context without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (two parameters, one required) and the presence of an output schema, the description is minimally adequate. However, it lacks usage guidelines and behavioral depth, which would improve completeness for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (both parameters have descriptions in the schema). The description adds no additional meaning about parameters beyond what is already structured, so it meets the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Read' and explicitly states the resource 'full source code of a function', making the action and target clear. It implies differentiation from siblings like 'summarize_function', but does not explicitly compare.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as 'summarize_function' or 'get_callers'. There is no mention of prerequisites, conditions, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
summarize_functionA
Deep-analyze a single function with LLM (summary + call extraction).
Call this after query_graph() to enrich specific functions. Results (summary, keywords, call edges) are stored in the graph and become available to get_callers(), get_callees(), get_call_path().
| Name | Required | Description | Default |
|---|---|---|---|
| function_name | Yes | Name of the function to analyze | |
| workspace_path | No | Target workspace (default: last configured) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility. It discloses that results (summary, keywords, call edges) are stored in the graph, implying a write operation. It does not explicitly mention mutational behavior or required permissions, but the side effects are described sufficiently for an LLM agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences long, each serving a distinct purpose: defining the action, specifying when to use it, and detailing the outcomes. It is front-loaded with the most critical information and contains no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description, combined with the fully documented schema and the presence of an output schema, provides sufficient completeness. It covers the tool's purpose, when to invoke it, and what happens to the data, making it well-suited for an AI agent to select and use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds context by referring to 'a single function,' which reinforces the function_name parameter's purpose. However, it does not elaborate on parameter details beyond the schema. This slight added value justifies a score of 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs a deep-LLM analysis of a single function, producing a summary and call extraction. It distinguishes itself from siblings by explicitly stating the invocation order (after query_graph) and noting that results feed into other tools like get_callers and get_callees.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly advises to call this tool after query_graph() to enrich specific functions, establishing a clear usage order and context. It also states that results become available to other tools, helping the agent understand the tool's role in the pipeline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
9 tool updates
v0.1.0- First observed
configure - First observed
get_call_path - First observed
get_callees - First observed
get_callers - First observed
graph_stats - First observed
preprocess_config - First observed
query_graph - First observed
read_function_body - First observed
summarize_function
TDQS
Scored across 9 tools
The tools are mostly distinct in purpose. `configure` and `preprocess_config` both relate to setup but target different aspects (general workspace vs. preprocessing for conditional compilation). Other tools like `read_function_body`, `query_graph`, and the call graph tools have clearly separate roles. A minor overlap exists but descriptions help disambiguate.
Tool names are inconsistent: some follow verb_noun (read_function_body, query_graph, summarize_function, get_callers), while `configure` is a bare verb, `preprocess_config` uses verb_noun but with a different verb style, and `graph_stats` is noun_noun with no verb. This mixed pattern reduces predictability.
9 tools is appropriate for a code analysis server covering configuration, code reading, graph indexing, function summarization, and call queries (callers, callees, paths). The scope feels well-balanced without being too heavy or too thin.
The tool set covers the main workflows for call graph analysis: setup, source retrieval, graph search, deep analysis, and call relationship queries. Missing features like variable cross-references or type queries are beyond the stated domain, so the set is reasonably complete for its purpose.
Maintenance
Related MCP Connectors
Repository knowledge graph MCP server for codebase understanding and debugging.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Related MCP Servers
- AlicenseBqualityFmaintenanceA Model Context Protocol server that enables LLMs to read, search, and analyze code files with advanced caching and real-time file watching capabilities.617 npm39MIT
- FlicenseDqualityDmaintenanceA comprehensive Model Context Protocol server for advanced code analysis that provides tools for syntax analysis, dependency visualization, and AI-assisted development workflow support.287-
- AlicenseNot gradedqualityFmaintenanceA powerful Model Context Protocol server that creates intelligent graph representations of your codebase with comprehensive semantic analysis capabilities, supporting 11 languages and 26 MCP methods.58 npm122MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for analyzing large C++ codebases with semantic search, crash dump analysis, and a web UI for configuration.1GPL 3.0