Skip to main content
Glama

modx_update_media_file

Overwrite file content inside a MODX media source by providing the source ID or name, path within the source, and new body.

Instructions

Overwrite a file's content inside a media source. source = id/name, path = file path within the source, content = new body.

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": {
      "source": "<source>",
      "path": "<path>",
      "content": "<content>"
    },
    "name": "modx_update_media_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
sourceYes
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.4

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden, and it only reveals that prior content is destroyed. It says nothing about required permissions, whether the source file must already exist, whether a backup or revision is kept, how binary/encoding is handled, or what the call returns.

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?

Two short sentences, the mutation and scope front-loaded, followed by a compact parameter gloss. Nothing is wasted and there is no filler.

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?

For a three-parameter destructive file write with no annotations and no output schema, the definition covers identity, target path, and payload adequately but omits error behavior, permission requirements, and encoding handling. It is workable but thin for a mutation tool.

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

Parameters4/5

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

Schema coverage is 0% — the schema lists three bare strings with no descriptions — and the description compensates by explaining all three, notably that `source` accepts either an id or a name and that `path` is relative to the source. That is genuine meaning beyond the schema, though content format/encoding for `content` is still unspecified.

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

Purpose4/5

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

Uses a specific verb ("Overwrite") plus a precise resource (a file's content inside a media source), which distinguishes it from the neighboring create/delete/rename/read media file tools. It stops short of naming those siblings explicitly, so the differentiation is inferred from the verb rather than stated.

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

Usage Guidelines3/5

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

"Overwrite" implies this is the tool for replacing content of an existing file, which implicitly routes agents away from modx_create_media_file. However, there is no explicit when-to-use clause, no statement about what happens if the file does not exist, and no mention of prerequisites such as write permission on the source.

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