Skip to content

fix(filesystem): clarify that search_files matches names, not contents#3716

Open
chasewhughes wants to merge 1 commit intomodelcontextprotocol:mainfrom
chasewhughes:fix/search-files-description
Open

fix(filesystem): clarify that search_files matches names, not contents#3716
chasewhughes wants to merge 1 commit intomodelcontextprotocol:mainfrom
chasewhughes:fix/search-files-description

Conversation

@chasewhughes
Copy link
Copy Markdown

Summary

Fixes #896 — the search_files tool description was ambiguous, leading AI assistants (including Claude) to misinterpret it as a content search (like grep) when it actually matches file/directory names against a glob pattern.

Changes

  • Clarified the opening sentence: "matching a pattern" → "whose names match a glob pattern"
  • Added an explicit note: "This searches by file/directory name only — it does not search file contents."

No logic changes — description only.

Test plan

  • Verified the implementation in lib.ts uses minimatch against relativePath (name-based matching)
  • Description now unambiguously communicates the tool's actual behavior

The description for search_files was ambiguous — it could be interpreted
as searching file contents (like grep) when it actually matches
file/directory names against a glob pattern. This caused AI assistants
to misuse the tool by passing content strings as the pattern.

Fixes modelcontextprotocol#896
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.

Confusing search_files function description leads to misunderstanding of its purpose

1 participant