git_grep
Find where a string or symbol appears in tracked files. Returns 'file:line:content' matches to locate usages in the codebase without a shell.
Instructions
Search tracked files for a pattern, returning 'file:line:content' matches. Use this to find where a string or symbol appears in the codebase — answering 'where is X used?' — without a shell. Best for: finding where a string appears in the codebase. Returns: 'file:line:content' matches, or 'No matches'. Pattern must not start with '-'; does NOT search commit messages or untracked files — use git_log with its grep filter for commit messages.
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": "git_grep"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | Files to search in; empty means all tracked files | |
| pattern | Yes | Search pattern; must not start with '-' | |
| repo_path | No | Path to the git repository, defaults to '.' (the server working directory) | . |