filesystem: realistic examples in search_files' description stop small models refusing to search (measured; follow-up to #896 / #3419)

Aperta Adatta ai principianti
#5,553 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
tooling

Direzione di ricerca

Trova la descrizione di search_files del server del file system e confronta gli esempi attuali con i modelli concreti nell’issue, come '/*.json' e '/invoice'. Leggi il caso di studio collegato per conoscere le varianti misurate. Aggiungi esempi di ricerca realistici e, se ti occupi del suggerimento facoltativo per i risultati vuoti, controlla come search_files formatta 'No matches found'; il lavoro è terminato quando la descrizione rispecchia gli esempi e il suggerimento spiega i modelli ricorsivi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement server-filesystem v2
Which server?

filesystem (@modelcontextprotocol/server-filesystem)

Protocol era

Both, or not era-specific

MCP client

No response

The problem

Server: @modelcontextprotocol/server-filesystem, measured on 2.0.0 and 2.2.0 (checked: 2.3.0 ships the same search_files description and the same empty result). Run with npx -y @modelcontextprotocol/server-filesystem@<version> <dir>, stdio, Node 24, macOS.

Thanks for the rewrite from #896 / #3419. We measured it, and it clearly fixes how agents search: a small model that does search now finds files reliably.

What it doesn't fix: on questions like "How many orders are there in total?", the model usually doesn't search at all. It answers on step 1, "I don't have access to any database or system that would contain order information", while the data sits one tool call away. In a controlled test the example patterns in the description decided this:

search_files description (server 2.0.0, 4 tasks x 3 runs, answers checked in code) Pass
2.0.0 original 2/12
2.2.0 / 2.3.0 text 2/12
precise rules + generic examples '**/*.ext', '**/name' 3/12
precise rules + concrete examples '**/*.json', '**/*invoice*' 9/12 (reproduced in 3 separate runs)

The only difference between the last two rows is the two example patterns. On the two affected tasks they went from 0/6 to 6/6, and with the concrete examples the model searched **/*order* and found the data.

Case study (method, all tables, caveats): https://github.com/Tanishq67m/AgentGrade/blob/main/docs/CASE_STUDY.md
Raw reports: https://github.com/Tanishq67m/AgentGrade/tree/main/results

Solution you have in mind (optional)
  1. Add one or two realistic examples next to the generic ones, e.g. '**/*.json', '**/*report*'. Small models seem to read abstract placeholders as "this is a file utility", not "the user's data is here".
  2. Replace the bare No matches found with a hint, e.g. "No matches for '' under ''. Patterns are relative to path; use '**/' to search subdirectories." In earlier runs agents repeated non-recursive patterns up to 9 times after a bare empty result.
Which MCP feature does it demonstrate? (optional)

No response

Alternatives or workarounds you have tried
  • Agent-side prompt advice ("Explore with the tools before saying information is unavailable"): 3/12 vs 1/12, still mostly refusals.
  • Advising "look at the folder layout first" in the description: no effect (1/12).
  • Removing search_files entirely: no effect (1/12); the refusal happens before any tool is chosen.
  • A larger model (gpt-oss-120b) solved 11/12 even on 2.0.0, so this mainly affects small, cheap models. One small model and synthetic data, 12 runs per row: indicative, not universal.
Already built it locally?

No server code was changed. Each description was tested by having the client show the model only a different search_files description, with the server binary unchanged and the same tasks and repeats. Verified by code-checked answers, 12 runs per variant. The exact texts are in the case study.

Before you submit
  • I searched existing issues and this is not a duplicate.
  • This is a request for this repository or one of its servers, not a new server, the MCP specification or an SDK.
Lingua principale
TypeScript
Stelle
92k
Fork
12k
Merge medio
3h 12m
PR unite (30g)
174

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/servers

Tutte le issue di modelcontextprotocol/servers

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.