Search source files
websiteSourceCode_files_searchFinds text across every source file and returns one entry per matching line with its file name, line, and column. Call this first to locate code, then read only the files it names with websiteSourceCode.files.read. pattern is literal text unless isRegex is set, and matching is line by line, so a pattern cannot span a newline. Narrow with nameGlob and type, ask for surrounding lines with contextLines, or set filesOnly for the cheapest orientation. Results are cursor-paginated over matches.
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": {
"websiteId": "<websiteId>",
"pattern": "<pattern>"
},
"name": "websiteSourceCode_files_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Only search files of this type. | |
| limit | No | Maximum matches to return per page. Defaults to 20, maximum 100. | |
| cursor | No | Opaque cursor from the previous page. Pass the returned `version` too to keep the search pinned. | |
| target | No | Version alias to read: `head` (default) or `published`. | |
| isRegex | No | Read `pattern` as a regular expression. JavaScript syntax works, including `\b`, `\d`, lookahead, and lazy quantifiers; named capture groups are not supported. | |
| pattern | Yes | Text to find. Literal unless `isRegex` is set. Matched line by line, so `^` and `$` anchor to line boundaries and a pattern cannot span a newline. | |
| version | No | Explicit source version. Takes precedence over `target`. | |
| nameGlob | No | Only search names matching this glob. `*` and `?` stop at a `/`; `**` crosses them, for example `blog/**`. | |
| filesOnly | No | Return one entry per matching file, with no line detail. | |
| websiteId | Yes | ||
| contextLines | No | Surrounding lines to return on each side of a match (0 to 3). Defaults to 0. | |
| caseSensitive | No | Match case exactly. Defaults to `true`. | |
| maxMatchesPerFile | No | Maximum matches from any one file (up to 50). Defaults to 10. |