Skip to main content
Glama

Write a file in the server folder

write_file
DestructiveIdempotent

Write server files like datapacks, configs, and server.properties inside the test server folder, creating directories as needed. Supports text or base64 content, optional overwrite, and size limits.

Instructions

Writes a file inside the test server folder, making folders as needed: datapacks (world/datapacks/...), configs, server.properties. Mods (.jar files and the mods folder) only if the person allowed it (allowModInstall). The world's chunk files, level.dat and eula.txt cannot be written. After writing server.properties the tool keeps RCON on 127.0.0.1. Use encoding base64 for binary files. Limited to maxFileBytes.

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

Input Schema

NameRequiredDescriptionDefault
pathYesPath inside the test server folder, for example "world/datapacks/my_pack/pack.mcmeta"
confirmNoSet true only after the person agreed to this change (needed while confirmDestructive is on).
contentYesFile content, as text or base64
encodingNotext
overwriteNoReplace a file that exists. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, but the description adds real behavioral context beyond them: which paths are forbidden, that parent folders are auto-created, that RCON is forced back to 127.0.0.1 after writing server.properties, that base64 is required for binary payloads, and that a maxFileBytes ceiling applies. These are non-obvious side effects and limits an agent could not infer from the annotations or schema.

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?

Content is front-loaded — action and scope first, then permissions and constraints. The middle sentence runs long with parentheticals ('datapacks (world/datapacks/...), configs, server.properties'), making it dense but still scannable; every clause carries constraint information.

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

Completeness4/5

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

For a destructive mutation with no output schema, the definition covers the safety envelope (protected files, confirm gating, size limit, mod permission) well. The remaining gap is return behavior — whether it reports bytes written or the resolved path — but the schema's confirm parameter carries the required approval contract.

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 80%, so a baseline of 3 applies, but the description adds genuine meaning: the maxFileBytes size ceiling is documented nowhere else, and the 'use encoding base64 for binary files' guidance clarifies when to pick the base64 enum value. It does not explain overwrite interaction with confirm, which is left to the schema.

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?

The description opens with a specific verb+resource ('Writes a file inside the test server folder') and immediately scopes it with the set of writable locations (datapacks, configs, server.properties) versus protected paths (chunk files, level.dat, eula.txt). An agent can tell this apart from read_file or import_schematic without opening any 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?

It gives clear context for when writing is permitted — mods only when allowModInstall has been granted — and encodes exclusions (protected world files cannot be written). It stops short of naming sibling alternatives (e.g. use import_schematic for schematics or list_files first to check existence), so routing is implied rather than explicit.

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