Search text inside files
nextcloud_search_file_contentsSearch for a word or phrase inside files below a folder and get the matching lines. Use it to locate content across text, PDF, and Office documents when you do not know file names.
Instructions
Search for a word or phrase INSIDE files below a folder and return the matching lines.
Reads the most recently changed readable files (text, CSV, Markdown, PDF, Word, Excel, PowerPoint, OpenDocument) one by one, so it is bounded by 'max_files' — narrow 'path' to the right folder for best results. Scanned PDFs without a text layer cannot be searched.
To find files by NAME use nextcloud_search_files (much faster). If the server has a full-text index, nextcloud_unified_search may also find content across all files.
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": {
"query": "<query>"
},
"name": "nextcloud_search_file_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Folder to search below. The narrower, the better. | / |
| query | Yes | Word or phrase to find (plain text, not a regex). | |
| documents | No | Also search PDF and office documents (slower). false = only plain text files. | |
| max_files | No | How many files to read at most (newest first). | |
| case_sensitive | No | ||
| modified_after | No | Only files changed on/after this date (YYYY-MM-DD). | |
| response_format | No | 'markdown' for readable output, 'json' for structured data | markdown |
| max_matches_per_file | No |