check_index_coverage: tools/list schema omits that at least one non-empty paths or scopes array is required

オープン 初心者向け
#3,130 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
api

調査の方向性

src/mcp/mcp.c:800-814 のツールスキーマと、src/mcp/mcp.c:7594-7603 の検証を確認してください。check_index_coverage の説明と入力スキーマがどのように組み立てられているかを調べ、paths または scopes が空でないことを求める実行時要件と比較してください。公開されるスキーマまたは説明が、実行時検証と同じ要件を伝えていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

editor/integration
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
  1. Dummy repository (/tmp/cbm-repro with one file app.py):

    def hello() -> str:
        return "ok"
    
  2. Index the repository, then call check_index_coverage with only the schema-required project field (via MCP tools/call or CLI):

    codebase-memory-mcp cli index_repository '{"repo_path":"/tmp/cbm-repro","name":"demo"}'
    codebase-memory-mcp cli check_index_coverage '{"project":"demo"}'
    
  3. Actual result: isError: true

    paths or scopes is required (arrays; max 128 paths and 32 scopes)
    

    (Passing {"project":"demo","paths":["app.py"]} succeeds and returns signal: best_effort.)

    Expected result: Either the tools/list schema/description documents that at least one non-empty paths or scopes array is required (matching src/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時間
マージ済み PR(30日)
90

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DeusData/codebase-memory-mcp のほかの issue

DeusData/codebase-memory-mcp の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。