Skip to content

fix(mcp): declare readOnlyHint on find_files/grep/multi_grep (#771) - #774

Merged
dmtrKovalenko merged 1 commit into
mainfrom
triage-bot/issue-771
Aug 13, 2026
Merged

dmtrKovalenko merged 1 commit into
mainfrom
triage-bot/issue-771

Conversation

@gustav-fff

@gustav-fff gustav-fff commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #771

Root cause

The three #[tool] macros in crates/fff-mcp/src/server.rs:422, :537, and :574 declared no annotations, so tools/list returned annotations: null. Clients that gate read-only access by readOnlyHint (plan mode, read-only sub-agents) treat missing annotations as potentially-mutating and block every fff tool, even though fff only reads the filesystem.

Fix

Add annotations(read_only_hint = true, destructive_hint = false, open_world_hint = false) to each of the three #[tool] attributes (find_files, grep, multi_grep). rmcp's macro emits these into the tools/list response.

Steps to reproduce

Pre-fix, on origin/main:

cargo build -p fff-mcp
cd /tmp && mkdir -p fff-mcp-repro && cd fff-mcp-repro && printf 'hello\n' > a.txt
BIN=/path/to/fff/target/debug/fff-mcp
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"r","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | "$BIN"

Expected: find_files, grep, multi_grep each carry "annotations": {"readOnlyHint": true, "destructiveHint": false}.
Actual (pre-fix): each tool has "annotations": null.

How verified

Rebuilt and re-ran the repro above:

find_files annotations= {"readOnlyHint": true, "destructiveHint": false, "openWorldHint": false}
grep       annotations= {"readOnlyHint": true, "destructiveHint": false, "openWorldHint": false}
multi_grep annotations= {"readOnlyHint": true, "destructiveHint": false, "openWorldHint": false}

cargo build -p fff-mcp clean. Diff is 6 insertions / 3 deletions in one file.

Automated triage via Gustav. Honk-Honk 🪿

Summary by CodeRabbit

  • Documentation
    • Clarified descriptions for file-finding and search tools.
    • Added guidance indicating these tools are read-only, non-destructive, and operate within a defined scope.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d2849888-f3b1-4a7d-ae5f-5a0e47bd5743

📥 Commits

Reviewing files that changed from the base of the PR and between 69651d8 and fbf2398.

📒 Files selected for processing (1)
  • crates/fff-mcp/src/server.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/fff-mcp/src/server.rs

📝 Walkthrough

Walkthrough

The MCP server updates descriptions for find_files, grep, and multi_grep. Each tool now declares read-only, non-destructive, closed-world behavior.

Changes

MCP tool metadata

Layer / File(s) Summary
Search tool declarations
crates/fff-mcp/src/server.rs
The tool descriptions add query guidance, literal-pattern details, examples, and performance notes. The tools also declare read-only, non-destructive, closed-world annotations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to fbf23

This localized change only declares accurate read-only metadata for three filesystem-search tools; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the MCP annotation change for all three affected tools.
Linked Issues check ✅ Passed The changes satisfy issue #771 by declaring read-only, non-destructive annotations for find_files, grep, and multi_grep.
Out of Scope Changes check ✅ Passed The changes are limited to tool descriptions and MCP annotations required by issue #771.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch triage-bot/issue-771

Comment @coderabbitai help to get the list of available commands.

find_files, grep, and multi_grep only read the filesystem but declared
no MCP tool annotations, so plan-mode / read-only clients blocked them.
Add annotations(read_only_hint = true, destructive_hint = false,
open_world_hint = false) to each #[tool].

Closes #771
@dmtrKovalenko
dmtrKovalenko merged commit c6194b8 into main Aug 13, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Suggestion]: fff-mcp doesn't declare MCP readOnlyHint on its tools, so plan-mode / read-only clients block all fff tools

2 participants