Skip to main content
Glama

modx_create_media_file

Creates a file in a MODX media source by writing content to a specified directory and filename.

Instructions

Create a file inside a media source (writes content). source = source id or name, path = target directory (relative to the source base), name = filename, content = file 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>",
      "name": "<name>"
    },
    "name": "modx_create_media_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
pathNoDirectory within the source (default root).
sourceYesMedia source id or name.
contentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.4

TDQS

B3.1/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 covers very little: it signals a write but says nothing about what happens if the file already exists (overwrite, error, version), whether intermediate directories are auto-created, or what permissions are required on the media source. For a mutating file-write tool with zero annotation coverage this is a meaningful gap.

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?

The purpose is front-loaded in the first clause, followed by a compact parameter glossary with no filler. The glossary partly restates schema fields, but since it adds semantics for the two undocumented parameters, the length is justified.

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?

Parameters are adequately covered, but with no annotations, no output schema, and no statement of return value or failure behavior, an agent cannot predict the result of a create against an existing path. Enough to invoke the tool correctly in the happy path, not enough to invoke it safely.

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 only 50% (only `source` and `path` are described in the schema), but the description compensates by defining all four: `source` as id or name, `path` as a directory relative to the source base, `name` as filename, and `content` as file body. The "relative to the source base" note in particular adds path-resolution meaning the schema does not supply.

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?

The description opens with a specific verb+resource pair ("Create a file inside a media source") and adds the clarifying parenthetical "(writes content)", which distinguishes creation-with-body from folder creation or listing. It does not explicitly contrast with modx_update_media_file or modx_create_media_folder, so sibling differentiation relies on the tool name alone.

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

Usage Guidelines2/5

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

There is no when-to-use guidance: nothing says to use modx_update_media_file when the file already exists, or modx_create_media_folder for directories. The agent must infer the create-vs-update split from naming conventions rather than from any stated rule.

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