search_project
Find a literal string across a project's text documents and return each match's file path, line, and column, so you can locate content without reading every document.
Instructions
Search a project's text documents for a literal string and return where it occurs, instead of reading every document. Returns matches [{ filePath, line, column, preview }], with 1-based line and column (UTF-16 units, as the editor counts) and preview the matching line cut to 160 characters around the match, with … where cut; totalMatches, every match including those past limit; truncated; filesSearched; and binaryFilesSkipped. query is matched literally, never as a regular expression, and ignoring case unless caseSensitive. path narrows the search to one document or a folder; one that names nothing is NOT_FOUND. Documents are read one at a time as read_file reads them, so text in a tracked deletion is not found, and at most 300 per call: it saves calls and context, not wall-clock time. A larger scope, or more matches than limit, returns what was found with truncated true.
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": {
"projectId": "<projectId>",
"query": "<query>"
},
"name": "search_project"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | A document, or a folder whose documents are searched | |
| limit | No | Most matches returned, 1 to 500; totalMatches still counts every one | |
| query | Yes | Literal text to find, 1 to 200 characters | |
| projectId | Yes | Overleaf project ID | |
| caseSensitive | No | Match case exactly; by default case is ignored |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| matches | Yes | ||
| truncated | Yes | ||
| totalMatches | Yes | ||
| filesSearched | Yes | ||
| binaryFilesSkipped | Yes |