You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mcp/server.rs
+26-13Lines changed: 26 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ fn mcp_docs_payload() -> Value {
90
90
"or_support":"Use any_terms:[...] for OR semantics. all_terms are ANDed.",
91
91
"wildcards":"Use path/file as glob-like filters. all_terms and any_terms are literal terms, not wildcard patterns.",
92
92
"regex":"Use the regex field for content regex matching. Provide only the pattern string and JSON-escape backslashes.",
93
-
"path_search_behavior":"path_search requires a non-empty plain fuzzy query and is for fuzzy path matching only.",
93
+
"path_search_behavior":"path_search requires a non-empty plain query string and performs case-insensitive substring matching on paths only.",
94
94
"file_list_behavior":"file_list enumerates directories and files with optional recursive depth and limit. Use path as a directory prefix, not a search query.",
95
95
"file_content_behavior":"file_content supports optional start_line/end_line (1-based, inclusive) to return snippets instead of full files.",
96
96
"recency_workflow":"For recent or older change questions: repositories -> repo_branches -> search by branch and compare indexed_at or is_live.",
@@ -116,7 +116,7 @@ fn mcp_docs_payload() -> Value {
116
116
"No branch results: call repo_branches and use the exact branch name.",
117
117
"Need OR behavior: place alternatives in any_terms:[\"termA\",\"termB\"].",
118
118
"Need regex matching: set the regex field instead of using wildcard plain terms.",
119
-
"Need directory listing: use file_list. Need fuzzy path lookup: use path_search."
119
+
"Need directory listing: use file_list. Need case-insensitive substring path lookup: use path_search."
120
120
]
121
121
},
122
122
"cookbook":[
@@ -126,7 +126,7 @@ fn mcp_docs_payload() -> Value {
126
126
"4) search({repo, branch, historical:true, all_terms:[\"term\"]}) for older snapshots",
127
127
"5) search({repo, regex:\"\\\\bQueryParser\\\\(\"}) for regex matching",
128
128
"6) file_list({repo, branch, path:\"src/mcp\", depth:2}) for directory enumeration",
129
-
"7) path_search({repo, branch, query:\"mcp serv\"}) for fuzzy path lookup",
129
+
"7) path_search({repo, branch, query:\"mcp_serv\"}) for case-insensitive substring path lookup",
130
130
"8) file_content({repo, branch, path, start_line?, end_line?}) for raw source text or snippets",
131
131
"9) For large files, prefer file_content with line snippets first, then expand only if needed",
132
132
"10) symbol_insights({params:{...}}) for definitions and references",
"instructions":"Use tools to query indexed code and symbol information; do not fall back to local filesystem reads for indexed lookup. Operational flow: repositories -> repo_branches -> file_list/path_search -> file_content/search/symbol_insights. search accepts structured JSON fields only; do not send a free-form `query` string. Keep filter values plain: do not include prefixes like `repo:`, `path:`, or `regex:` inside field values. all_terms are AND semantics and any_terms are OR semantics (fanout + dedupe). For recency/version questions like 'recent change', call repo_branches first, then run search with explicit branch values and compare indexed_at/is_live metadata; add historical:true when historical snapshots should be included. Plain terms do not support wildcard matching; use the regex field for pattern matching. path_search requires a non-empty plain fuzzy query and is not a directory listing endpoint; use file_list for enumeration. For large files, call file_content with start_line/end_line first to limit context size.",
202
+
"instructions":"Use tools to query indexed code and symbol information; do not fall back to local filesystem reads for indexed lookup. Operational flow: repositories -> repo_branches -> file_list/path_search -> file_content/search/symbol_insights. search accepts structured JSON fields only; do not send a free-form `query` string. Keep filter values plain: do not include prefixes like `repo:`, `path:`, or `regex:` inside field values. all_terms are AND semantics and any_terms are OR semantics (fanout + dedupe). For recency/version questions like 'recent change', call repo_branches first, then run search with explicit branch values and compare indexed_at/is_live metadata; add historical:true when historical snapshots should be included. Plain terms do not support wildcard matching; use the regex field for pattern matching. path_search requires a non-empty plain query string and performs case-insensitive substring matching over paths; it is not a directory listing endpoint, so use file_list for enumeration. For large files, call file_content with start_line/end_line first to limit context size.",
"regex":{"type":"string","description":"Content regex pattern only. Do not prefix with `regex:`. JSON-escape backslashes, for example \"\\\\bQueryParser\\\\(\"."},
"description":"Enumerate files/directories under a path for a repository+branch from the index. Supports bounded recursive traversal with depth and limit. Use this for directory listing workflows and then call file_content on specific files. `path` is a directory prefix, not a fuzzy search query. Response includes truncated flag, branch freshness, and stable paths.",
407
+
"description":"Enumerate files/directories under a path for a repository+branch from the index. Supports bounded recursive traversal with depth and limit. Use this for directory listing workflows and then call file_content on specific files. `path` is a directory prefix, not a substring search query. Optional cursor/auto_paginate can fetch more results while preserving truncation and narrowing guidance. Response includes truncated flag, branch freshness, and stable paths.",
408
408
"inputSchema":{
409
409
"type":"object",
410
410
"properties":{
411
411
"repo":{"type":"string"},
412
412
"branch":{"type":"string"},
413
-
"path":{"type":"string","description":"Directory prefix to enumerate from. Example: \"src/mcp\". Do not send a fuzzy query here."},
413
+
"path":{"type":"string","description":"Directory prefix to enumerate from. Example: \"src/mcp\". Do not send a substring search query here."},
"description":"Search file and directory paths within a repository and branch using a non-empty plain fuzzy query (fuzzy path lookup). This is path-only matching and does not enumerate full directory contents; use file_list for enumeration and file_content for file bodies. Do not send filter syntax like `path:` or glob patterns here. Includes freshness metadata.",
432
+
"description":"Search file and directory paths within a repository and branch using a non-empty plain query string. Matching is case-insensitive substring matching on path text (single query string, not OR-token search). This is path-only matching and does not enumerate full directory contents; use file_list for enumeration and file_content for file bodies. Do not send filter syntax like `path:` or glob patterns here. Optional cursor/auto_paginate can fetch additional path matches. Includes freshness metadata.",
427
433
"inputSchema":{
428
434
"type":"object",
429
435
"properties":{
430
436
"repo":{"type":"string"},
431
437
"branch":{"type":"string"},
432
-
"query":{"type":"string","description":"Plain fuzzy text only. Example: \"mcp serv\". Do not send `path:src/mcp` or glob syntax here."},
"query":{"type":"string","description":"Plain query string only. Example: \"mcp_serv\". Matching is case-insensitive substring matching over path text. This is a single query string, not OR token search. Do not send `path:src/mcp` or glob syntax here."},
if tool == "path_search" && lower.contains("plain fuzzy text"){
474
+
if tool == "path_search" && lower.contains("plain query string"){
369
475
return(
370
476
"path_search_invalid_query_syntax".to_string(),
371
477
err,
372
478
Some(
373
-
"Use plain fuzzy text like `mcp serv` for path_search. Use file_list.path for directory prefixes and search.path/search.file for filters."
479
+
"Use a plain query string like `mcp_serv` for path_search (case-insensitive substring matching). Use file_list.path for directory prefixes and search.path/search.file for filters."
0 commit comments