feat(filesystem): add idempotentHint and openWorldHint annotations#3875
feat(filesystem): add idempotentHint and openWorldHint annotations#3875ykshah1309 wants to merge 1 commit into
Conversation
Add idempotentHint: true to all 10 read-only tools (reads are inherently safe to retry) and openWorldHint: false to all 14 tools (all operations are scoped to allowed directories with no external side effects). Closes modelcontextprotocol#3402
|
@claude review |
|
Claude finished @cliffhall's task in 1m 31s —— View job PR Review
Overall: Clean, correct, and spec-compliant. This PR completes annotation coverage for the filesystem server with well-reasoned values.
|
| Tool | idempotentHint |
destructiveHint |
Assessment |
|---|---|---|---|
write_file |
true |
true |
✓ Overwrites idempotently; destructive because prior content is lost |
edit_file |
false |
true |
✓ Applying the same edit twice yields different results |
create_directory |
true |
false |
✓ mkdir -p is idempotent; no destruction |
move_file |
false |
true |
✓ Second call with same args fails (destination exists); not idempotent |
All pre-existing values hold up under scrutiny.
Suggestion: list_allowed_directories and dynamic Roots
list_allowed_directories returns the server's current allowed directories, which can change at runtime via MCP Roots updates. This doesn't affect the correctness of idempotentHint: true (the hint is about side effects, not result consistency), but it's worth knowing. No change needed.
Verdict
No issues found. The annotations are accurate and the PR description matches the diff exactly (10 read-only tools get idempotentHint, all 14 get openWorldHint: false). Ready to merge.
Summary
Adds
idempotentHintandopenWorldHintto tool annotations in server-filesystem, completing the annotation coverage for all four standard MCP hints.Closes #3402
Changes
idempotentHint: trueto 10 read-only tools — reads are inherently safe to retry and produce identical resultsopenWorldHint: falseto all 14 tools — every operation is scoped to allowed directories with no network access or external side effectsTesting
Metadata-only change with no behavioral impact.
npm run build --workspace=src/filesystemcompiles cleanlynpm test --workspace=src/filesystem— all 146 tests pass