代码知识图谱 MCP Agent - 基于 Tree-sitter 的代码智能分析工具。提供代码结构分析、函数调用关系查询、变更影响分析、模块依赖检测等能力。
CodeGuard has 16 tools with schemas and descriptions present, but quality is inconsistent. Tool names follow verb_noun convention (load_project, query_callers, search_functions), which is good. However, descriptions are often vague or lack actionable context. Many parameters lack type information in visible schemas, e.g., 'limit' in search_functions shows type 'integer' but no min/max bounds. Output schemas are not documented anywhere in the source. Error handling is absent, no guidance on what to do if a project fails to load or a function is not found. The 'ask' tool (tool 14) is particularly problematic: it accepts free-form natural language with no constraints, making it difficult for LLMs to know when to invoke it vs. structured query tools. Parameter descriptions are present but generic (e.g., 'project路径(缺省用最近加载的项目)' repeats across 10+ tools without explaining dependencies or failure modes). No evidence of pagination support despite tools like search_functions and query_callers that could return large result sets.
变更影响分析:如果修改指定函数,会影响哪些地方。
分析项目的模块依赖关系,检测核心模块和循环依赖。
用自然语言提问代码相关问题,多 Agent 协作回答。
版本图谱对比:两个 git 版本之间的代码差异(文件/函数/类/调用/影响)。
查看指定文件中的类和函数结构。
获取函数的详细信息(所在文件、行范围、文档、调用关系)。
查看当前项目的代码统计信息(文件/函数/类/调用/Import 数量)。
Output schemas not documented. Tools like search_functions, query_callers, and analyze_impact return results but no schema is visible in source code. LLMs cannot plan downstream tool calls without knowing what fields to expect.
No pagination or result limits documented. search_functions accepts 'limit' (default 30, max 500) but no offset/cursor mechanism visible. Large result sets will blow context windows.
Error handling absent. No guidance on what happens if a project fails to load, a function is not found, or a git ref is invalid. Descriptions lack recovery hints like 'Try search_functions() if the exact name is unknown.'
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 62 | 2026-07-28+ | v2 |
列出所有已加载的项目及其统计信息。
加载一个代码项目(解析 + 建图缓存)。返回统计信息;之后可用 project 参数指定它。
查询指定函数内部调用了哪些函数。
查询指定函数被哪些地方调用了。
重新解析已加载的项目,更新缓存(代码改动后刷新知识)。
版本审查:对比两个 git 版本,输出变更清单 + 逐函数影响 + AI 审查摘要。
按关键词搜索代码中的函数/方法。
卸载项目,释放缓存。
生成代码图谱可视化 HTML 文件(用浏览器打开可交互查看)。
Tool 'ask' (natural language query) lacks constraints. Free-form string with no enum, pattern, or length limit. LLMs cannot distinguish when to use 'ask' vs. structured tools like query_callers or search_functions.
Parameter descriptions are generic and repetitive. 'project路径(缺省用最近加载的项目)' appears in 10+ tools without explaining what happens if the project is not loaded, or how to discover available projects.