Options
Regular expression pattern to search for
Whether search should be case sensitive (default: true)
Git reference to search in (defaults to repository’s default branch)
Array/List of Git pathspecs to limit search scope
Glob patterns for files to include
Glob patterns for files to exclude
File extensions to filter by (e.g.,
['.js', '.py'])Number of lines to include before each match
Number of lines to include after each match
Maximum total lines to return (default: 2000, max: 2000)
Maximum matches per file (default: 200)
Pagination cursor from previous response
Maximum results per page (default: 200)
Token TTL. Token TTL in seconds.
Response
The grep response includes:query: Echo of search parameters with resolved defaultsrepo: Information about the searched ref and commitmatches: Array of files with matching lines- Each match contains
pathandlinesarray - TypeScript: Lines include
lineNumber,text, andtype('match'or'context') - Python: Lines include
line_number,text, andtype('match'or'context')
- Each match contains
- TypeScript:
hasMoreandnextCursorfor pagination - Python:
has_moreandnext_cursorfor pagination