search_code
Find exact code strings in Mozilla repositories using literal matching. Search for specific terms, function names, or code snippets across Mozilla codebases.
Instructions
Search for code in Mozilla repositories using Searchfox. IMPORTANT: Uses exact string matching only - no search operators, no OR logic, no phrase matching with quotes. Multiple words are treated as a single literal string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query using exact literal string matching. CRITICAL: Do NOT use multiple words expecting OR logic (e.g., 'profiler raptor' won't find files containing either word separately). Do NOT use quotes around terms (e.g., '"profiler" "raptor"' searches for literal quotes). Use single specific terms, function names, or exact code snippets. For broader searches, use separate queries or enable regexp mode. | |
| repo | No | Repository to search in (e.g., mozilla-central, comm-central) | mozilla-central |
| path | No | Filter results by file path using glob patterns. Path matching uses substring matching - a path matches even if only part of it matches the glob. Use ^ and $ operators to match beginning or end of path (e.g., '^tools/profiler' to match paths starting with tools/profiler, 'profiler$' to match paths ending with profiler). | |
| case | No | Enable case sensitive search (default: case insensitive) | |
| regexp | No | Treat query as regular expression pattern | |
| limit | No | Maximum number of results to return |