Files
Martin Vogel fe3c285fdc fix(mcp): annotate get_file_outline and ingest_traces as read-only (#2118)
v0.11.0 corrected the ten query tools reported in #2118, but two entries
in TOOL_ANNOTATIONS still advertised the wrong behaviour in tools/list:

- get_file_outline was {readOnlyHint:false, destructiveHint:true}. It was
  added after the read-only split and kept a conservative default, yet it
  reads through the same non-mutating resolve_store() query path as
  search_graph and friends and never writes.
- ingest_traces was {readOnlyHint:false, idempotentHint:false}. Its
  handler only parses and counts the traces array (edge creation is not
  implemented), so it writes nothing and is idempotent.

Clients that gate auto-approval on these hints prompted for, or skipped,
two safe tools. Both are now read-only, non-destructive and idempotent.
The handlers that write user-visible state (index_repository, manage_adr,
delete_project) keep their annotations unchanged.

A new test walks the registered tool list (cbm_mcp_tool_count /
cbm_mcp_tool_name) rather than a mirrored table and asserts that only an
explicit mutator allowlist may clear readOnlyHint and only its destructive
subset may set destructiveHint, so a newly added tool cannot inherit a
wrong default unnoticed. The exact-value table test is updated to match.

Refs #2118
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-09-28 00:02:07 +02:00
..