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.
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) | . |