Skip to main content
Glama

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

NameRequiredDescriptionDefault
idNo
nameNo
typeYes
end_lineNo1-based last line of the window (default = end of file).
start_lineNo1-based first line of the window (default 1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.4

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the return shape ('Returns total_lines and the numbered window') and implies a read-only operation via 'View', which is genuinely helpful given there is no output schema. It says nothing about permissions, behavior when the element does not exist, or how id vs name resolution conflicts are handled.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with the distinguishing behavior front-loaded and the sibling hand-off immediately after. The final 'Returns total_lines and the numbered window' is mildly redundant with the opening line, but it earns its place as the only statement of return shape given no output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, the line-numbering value proposition, and the return shape, which is reasonable for a 5-parameter read tool with no output schema and no annotations. However, the unresolved id-vs-name targeting question is something an agent genuinely needs before calling, and the description leaves it entirely to the schema, which is only 40% documented.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 40%, and the uncovered parameters are the important ones: `id` and `name` are both optional with no explanation of precedence, mutual exclusivity, or whether one is required in practice. The description's window discussion only restates what start_line/end_line already say in the schema. For a tool that identifies its target by either ID or name, that gap is significant.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('View a chunk/snippet/template/plugin') plus the defining characteristic: output is NUMBERED lines like `cat -n`. That numbered-line framing distinguishes it cleanly from modx_get_element and modx_list_elements without needing to open a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent forward: 'Use this to find the exact line numbers to edit with modx_edit_element_lines', with a cost rationale ('cheaper than pulling the whole element'). It lacks an exclusion rule for when to prefer plain modx_get_element instead, but the when-to-use guidance is clear and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools