check_index_coverage: tools/list schema omits that at least one non-empty paths or scopes array is required
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 src/mcp/mcp.c:800-814 中的工具 schema 和 src/mcp/mcp.c:7594-7603 中的验证逻辑。检查 check_index_coverage 的描述和输入 schema 是如何组装的,然后将它们与运行时要求进行比较:paths 或 scopes 必须非空。当发布的 schema 或描述传达了与运行时验证相同的要求时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Version
v0.12.1 (built from source at commit 9a4da7a3; also verified unchanged on main d5e39e5a)
Platform
Linux (x64)
Install channel
Built from source
Binary variant
standard
What happened, and what did you expect?
Calling check_index_coverage with only the required project argument (e.g., {"project": "demo"}) — or with empty arrays {"project": "demo", "paths": []} — is completely valid according to the MCP tools/list schema and tool description, but handle_check_index_coverage rejects the call at runtime with isError: true:
paths or scopes is required (arrays; max 128 paths and 32 scopes)
In src/mcp/mcp.c:800-814 (main d5e39e5a), the published tool schema only marks project as required, gives paths and scopes neither description nor minItems, and the tool description does not mention that at least one non-empty paths or scopes array must be supplied:
{
"name": "check_index_coverage",
"description": "Best-effort exact-path/scope coverage and freshness, paged separately. full diagnostics adds raw detail. Clean is not proof of completeness.",
"inputSchema": {
"type": "object",
"properties": {
"project": { "type": "string" },
"paths": { "type": "array", "items": { "type": "string" }, "maxItems": 128 },
"scopes": { "type": "array", "items": { "type": "string" }, "maxItems": 32 },
"...": "..."
},
"required": ["project"]
}
}
Meanwhile handle_check_index_coverage (src/mcp/mcp.c:7594-7603) enforces (path_count == 0U && scope_count == 0U) and immediately returns an error.
Expected: The MCP tools/list description and/or inputSchema should clearly declare this precondition (for example, noting in the description that at least one non-empty paths or scopes array is required, and/or adding minItems: 1 / anyOf constraints) so MCP clients/agents do not construct schema-valid calls that fail at runtime.
Reproduction
-
Dummy repository (
/tmp/cbm-reprowith one fileapp.py):def hello() -> str: return "ok" -
Index the repository, then call
check_index_coveragewith only the schema-requiredprojectfield (via MCPtools/callor CLI):codebase-memory-mcp cli index_repository '{"repo_path":"/tmp/cbm-repro","name":"demo"}' codebase-memory-mcp cli check_index_coverage '{"project":"demo"}' -
Actual result:
isError: truepaths or scopes is required (arrays; max 128 paths and 32 scopes)(Passing
{"project":"demo","paths":["app.py"]}succeeds and returnssignal: best_effort.)Expected result: Either the
tools/listschema/description documents that at least one non-emptypathsorscopesarray is required (matchingsrc/mcp/mcp.c:7594-7603), or omitting both defaults to a valid project-level response.
Logs
No stderr errors; deterministic MCP tool error returned on stdout:
paths or scopes is required (arrays; max 128 paths and 32 scopes)
Diagnostics trajectory (memory / performance / leak issues)
N/A (MCP schema / validation mismatch, not a memory or performance issue).
Project scale (if relevant)
1 file / minimal dummy snippet
Confirmations
- I searched existing issues and this is not a duplicate.
- My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.
- 主要语言
- C
- 星标
- 45.8k
- 派生
- 3.8k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 90
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DeusData/codebase-memory-mcp 的其他 Issue
-
parsing/quality
难度 2/5 1-3 小时 新手友好度 75/100
DeusData/codebase-memory-mcp#3062 · 1 条评论 ·
维护者通常 1 天内回复
-
bug editor/integration parsing/quality windows
难度 2/5 1-3 小时 新手友好度 75/100
DeusData/codebase-memory-mcp#3050 ·
维护者通常 1 天内回复
-
editor/integration parsing/quality
难度 2/5 1-3 小时 新手友好度 68/100
DeusData/codebase-memory-mcp#2286 ·
维护者通常 1 天内回复
-
install writes an unsupported `args` key into the Claude Code SubagentStart hook, so it never runs未关闭bug editor/integration priority/high stability/performance ux/behavior
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2239 · 1 条评论 ·
维护者通常 1 天内回复
-
bug priority/high ux/behavior
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2232 · 2 条评论 ·
维护者通常 1 天内回复
查看 DeusData/codebase-memory-mcp 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 84/100
ossc-db/pg_hint_plan#255 ·
-
Status: Opened
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
awslabs/aws-c-common#1319 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 13 天内回复