modx_view_element
View MODX chunks, snippets, templates, or plugins as numbered lines with optional start/end windows to locate exact lines before editing.
Instructions
View a chunk/snippet/template/plugin as NUMBERED lines (like cat -n), optionally windowed by start_line/end_line. Use this to find the exact line numbers to edit with modx_edit_element_lines — cheaper than pulling the whole element. Returns total_lines and the numbered window.
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": {
"type": "<type>"
},
"name": "modx_view_element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| name | No | ||
| type | Yes | ||
| end_line | No | 1-based last line of the window (default = end of file). | |
| start_line | No | 1-based first line of the window (default 1). |