Skip to main content
Glama

modx_update_element

Replaces a MODX element’s complete content in one update. Use it for small elements or full rewrites; for minor changes in large elements, use line-based editing instead.

Instructions

Update a MODX element by REPLACING its whole content (send the complete new content). Best for small elements or full rewrites. For a few changes inside a large chunk/snippet/template/plugin, do NOT use this — use modx_view_element + modx_edit_element_lines instead (sends only the changed lines, far fewer tokens, atomic with a safety anchor).

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_update_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNo
newNo
nameNo
sizeNo
tagsNo
typeYes
aliasNo
colorNo
priceNo
eventsNo
parentNo
vendorNo
weightNo
articleNo
captionNo
contentNo
made_inNo
popularNo
remainsNo
categoryNo
favoriteNo
hidemenuNo
isfolderNo
templateNo
class_keyNo
introtextNo
menutitleNo
old_priceNo
publishedNo
templatesNo
field_typeNo
context_keyNo
media_sourceNo
input_propertiesNo
_runtime_preconditionsNoInternal Site Agent Runtime CAS preconditions. Not intended for manual model-authored calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.4

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden; it does well on the headline behavior (content is REPLACED wholesale, so partial payloads destroy data) and hints at token cost and atomicity of the alternative. It is silent on whether omitted fields among the other ~30 properties are preserved or reset, whether the change is reversible, and what permissions or versioning apply to a mutation.

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

Conciseness5/5

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

Three sentences, front-loaded with the destructive core ('REPLACING its whole content') and the required payload instruction, then the routing advice. No filler, and the caps and parentheticals earn their space by flagging the failure mode and the cost tradeoff.

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

Completeness2/5

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

For a 35-parameter mutation with no annotations and no output schema, the definition covers only the content-replacement path and ignores the rest of the surface. An agent still cannot tell which element types are valid targets for which fields, whether partial updates are merge-safe, or what the tool returns after the write.

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 3% across 35 parameters, so the description must compensate and it explains only `content` (send the complete value). The remaining properties, including product-like fields (price, vendor, remains, made_in) and structural ones (template, class_key, published, _runtime_preconditions), get no guidance on when to set them or how they interact with the content replacement.

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 concrete verb and resource ('Update a MODX element') and immediately narrows the semantics to a full-content replacement, which distinguishes it from the sibling modx_edit_element_lines without opening any schema. An agent can tell which of the two element-mutating tools it wants from the first sentence alone.

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

Usage Guidelines5/5

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

Gives an explicit when ('small elements or full rewrites') and an explicit when-not ('a few changes inside a large chunk/snippet/template/plugin') with the exact alternative named as modx_view_element + modx_edit_element_lines. It even explains the selection rationale (fewer tokens, atomic with a safety anchor), leaving nothing to inference.

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