modx_search_code
Search MODX element and resource content and names to find where a string appears, including references; returns matching line details for direct edits.
Instructions
Full-text search across element and resource CONTENT (and names). Finds the chunk/snippet/template/plugin/TV/resource that contains a string, including where an element is referenced or mentioned. Matches static elements by reading their static file. Use this to navigate the codebase (e.g. query 'header' finds the header chunk and everything that uses or mentions it). Each content hit returns id, line (1-based line of the match) and line_text (the exact line, verbatim) — so for a one-line change you can go straight to modx_edit_element_lines using line as start_line/end_line and line_text as expect, with no separate read. For multi-line context, open a window with modx_view_element around line.
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": "modx_search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default 50, max 200). | |
| query | Yes | Substring to search for. | |
| types | No | Element/resource types to search. Default: all. | |
| case_sensitive | No | Case-sensitive match (default false). |