grep_code tool
Tool: grep_code
Regex and full-text fallback search across the repository, for when a literal text match is more useful than a structural query.
Arguments Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
| pattern | string | Required | Regex or exact text pattern to search. |
| repo_path | string | Required | Absolute path to the workspace root. |
| budget | string | Optional | Token boundary limit (small, medium, large). |
Tool Input JSONRequest
{
"pattern": "WithInstructions",
"repo_path": "/path/to/repo",
"budget": "small"
}Tool Response JSONResponse
[
{
"file": "internal/mcpserver/server.go",
"line": 14,
"content": "server.WithInstructions(skill.Instructions()),"
}
]Developer Best Practices
- Reach for the structural tools (find_symbol, search_code) first; use grep_code when only a literal match will do.
- Supply a budget on broad patterns to avoid flooding the context window.