Skip to main content
Glama
axross-headless-mcp

axross-headless-mcp

Write file

write_file
DestructiveIdempotent

Create a file or replace its entire contents with text or bytes, using atomic writes on local disk. Use it to save content to one file; check existence first if the file must be new.

Instructions

Create a file or replace its whole contents with text or bytes. Use when: saving content to one file; to edit, read_file, change, write back. It always replaces: when the file must not exist yet, check with get_path_info first. Instead: copy_file to duplicate a file; create_directory for folders. Behavior: destructive - replaces the file. Atomic on the local disk (temp file, rename): a replaced file keeps its mode, a new one gets 0600. The parent must exist; a symlink at path is followed, a folder fails. The 16 MiB limit is the whole request, so content_b64 carries about 12 MiB. Time limit: 30 s. Returns: {size: bytes written}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoThe file to create or replace (absolute, or relative to the MCP root). Required unless path_b64 is given.
backendNoBackend id from list_backends; omit for the default.
contentNoThe new content as text, stored UTF-8 encoded. Required unless content_b64 is given; not both.
path_b64Nopath as base64 of its raw bytes, for non-UTF-8 names; replaces path.
content_b64Nocontent as base64 of the raw bytes, for binary files; give this or content.

Output Schema

NameRequiredDescriptionDefault
sizeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv0.15.181
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / backend / description
      Previous value: -"Optional backend id. Omit to use the default; call 'list_backends' to enumerate."New value: +"Backend id from list_backends; omit for the default."
    • changedInput schema / properties / content / description
      Previous value: -"The new content as UTF-8 text."New value: +"The new content as text, stored UTF-8 encoded. Required unless content_b64 is given; not both."
    • addedInput schema / properties / content_b64 / contentEncoding
      Added value: +"base64"
    • changedInput schema / properties / content_b64 / description
      Previous value: -"The new content as base64 bytes."New value: +"content as base64 of the raw bytes, for binary files; give this or content."
    • addedInput schema / properties / path / description
      Added value: +"The file to create or replace (absolute, or relative to the MCP root). Required unless path_b64 is given."
    • addedInput schema / properties / path / minLength
      Added value: +1
    • addedInput schema / properties / path_b64 / contentEncoding
      Added value: +"base64"
    • changedInput schema / properties / path_b64 / description
      Previous value: -"Instead of path: base64 of the name's raw bytes, for a name that is not UTF-8 (listings give such a name as U+FFFD plus a path_b64 / name_b64 field)."New value: +"path as base64 of its raw bytes, for non-UTF-8 names; replaces path."
    • removedInput schema / required
      Removed value: -[
      -  "path"
      -]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "size": {
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "size"
      +  ],
      +  "type": "object"
      +}
  2. Addedv0.15.180

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: atomicity via temp-file rename, mode preservation on replace vs 0600 on creation, parent-must-exist, symlink following, folder failure, 16 MiB whole-request limit with the resulting ~12 MiB for content_b64, and a 30 s timeout. The annotations only say destructive/idempotent/open-world, so this adds substantial operational context.

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?

Front-loaded with the action, then organized into labeled blocks (Use when / Instead / Behavior / Returns). Telegraphic fragments carry real information rather than filler.

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

Completeness5/5

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

For a destructive five-parameter write tool with a full output schema, everything an agent needs to invoke it safely is present: preconditions, failure modes, size and time limits, and file-metadata effects. The 'Returns' line is slightly redundant given the output schema but does no harm.

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 100%, so the baseline is 3, and the description earns above that by explaining the 16 MiB request budget and its consequence for content_b64 payload size. Path vs path_b64 exclusivity is already documented in the schema, so no further lift was needed.

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 with scope: 'Create a file or replace its whole contents with text or bytes.' The 'replace' half is called out explicitly, which distinguishes it from readers and copiers among the siblings.

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-to-use rule ('saving content to one file'), a routing flow for editing ('read_file, change, write back'), a precondition ('check with get_path_info first' when the file must not exist), and named alternatives ('copy_file to duplicate a file; create_directory for folders').

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