find_in_codebase
Search a codebase for exact literal or regex pattern matches and return file paths, line numbers, and context snippets for precise code lookup.
Instructions
Find exact literal or regex pattern matches in the codebase.
Runs entirely locally — no embedding model, no external LLM call. Returns file paths, line numbers, and context snippets for each match. Use this instead of search_codebase_tool when you need precise text matches (e.g. "session_id", "def authenticate", a specific import).
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": {
"pattern": "<pattern>"
},
"name": "find_in_codebase"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| file_glob | No | ||
| use_regex | No | ||
| project_root | No | ||
| case_sensitive | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |