code_grep
Searches readable workspace files for literal text such as config keys, routes, SQL, JSON, YAML, or log messages, and accepts wildcards to query all enabled workspaces at once.
Instructions
Finds literal TEXT in any readable file of a workspace, not only C#: config keys, routes, log messages, SQL, JSON, YAML, Razor, scripts, markdown. WILDCARD SUPPORT: pass workspace='' to search ALL enabled workspaces at once. Files are read from disk on every call, so results are never stale and every line number is the real line (valid for code_read and file_edit_lines until the file changes). Matching is plain text on one line (no regex), any letter case unless caseSensitive=true. Results come in path order with the matching lines. Use code_search for C# type and member NAMES (ranked, forgiving); use code_grep when the text is not a name. Not searched: files the access policy blocks, vendored folders (wwwroot/lib, dist, vendor), .min. and minified files, binary files and files over about 1 MB; the result says how many were left out. Examples: code_grep('MyApi', 'ConnectionStrings') | code_grep('', 'api/orders', pathGlob='/*.cs') | code_grep('MyApi', 'TODO', pathGlob='src/Orders/').
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace": "<workspace>",
"query": "<query>"
},
"name": "code_grep"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Optional: page number, 1-based (default 1). | |
| guide | No | true: put the code guide first in the result. Use on your first code call, or when told it changed. | |
| query | Yes | Literal text to find on one line (not a pattern, no line breaks) | |
| pageSize | No | Optional: matching lines per page (default 50, max 200). Use with 'page' to read further. | |
| pathGlob | No | Optional: limit to workspace-relative paths. '*' stays inside a folder, '**' crosses folders, '?' is one character. Without '/' it matches the file name in any folder: '*.json', 'src/Orders/**', '**/appsettings*.yml' | |
| workspace | Yes | Workspace name as shown in Waymark, or '*' for ALL enabled workspaces | |
| caseSensitive | No | Optional: case-sensitive match (default false) |