Search the project
search_projectSearch an Overleaf project's text sources for a literal string or JavaScript regex, returning matching lines as path:line: text. Use it to find citations, labels, or commands when the file is unknown.
Instructions
Search the project's text sources for a literal string or a regular expression, returning matching lines as path:line: text. Use it to find where a term, citation key, label or command appears when you do not know which file holds it; once you do, use read_file or read_section, and use list_files to find a file by name. Only .tex, .ltx, .bib, .cls, .sty, .bst, .txt and .md files are searched, and a file created locally is not searched until push_changes commits it. Both modes are case-insensitive and match one line at a time, so a pattern cannot span lines. A regular expression uses JavaScript syntax, sees the first 4,000 characters of each line, and is abandoned with an error after 10 seconds; an invalid one fails with its syntax error. maximumMatches counts matching lines, taken in path order. Pulls from Overleaf first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | What to look for. Literal text by default, so LaTeX backslashes need no escaping; a regular expression when isRegularExpression is true. | |
| project | No | Which project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project. | |
| maximumMatches | No | Stop after this many matches, between 1 and 500 (default 100). | |
| isRegularExpression | No | Treat query as a regular expression instead of literal text (default false). |