Skip to main content
Glama

Write text file

write_file
Destructive

Create or replace a text file (css, js, json, svg, txt, xml) in the draft, e.g. "css/site.css".

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

Input Schema

NameRequiredDescriptionDefault
pathYes
siteYesSite slug (e.g. "kopitiam-muar") or id
contentYes
expected_revisionNoRevision from read_page; the save is refused if the file changed since. "new" = must not exist yet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the bar is lowered, and the description usefully adds that the write targets the draft rather than the published site. It does not disclose that 'replace' silently overwrites existing content, nor the 5 MB content ceiling, nor that a stale-revision conflict will be refused (that detail lives only in the schema).

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?

A single front-loaded sentence with zero filler: verb, resource, allowed types, scope, and a path example. Every clause carries information an agent needs to construct a call.

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 destructive 4-parameter write with no output schema and half its parameters undocumented, the definition covers scope and path shape but leaves gaps: overwrite semantics, size limits, and error behavior on revision mismatch are unaddressed in the description. Adequate to call correctly, not complete enough to predict consequences.

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

Parameters3/5

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

Schema coverage is only 50%: site and expected_revision are documented in the schema while path and content are bare. The description partially compensates by giving the path format example 'css/site.css', but adds nothing about content (format, encoding, size limit) beyond the schema's maxLength.

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?

States a specific verb pair ('Create or replace') plus the resource ('a text file') and constrains it to the draft with an enumerated set of extensions and a concrete path example. It implicitly separates itself from write_page and upload_asset via 'text file', but never names those siblings explicitly.

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?

'Create or replace' implies an upsert and 'in the draft' implies it will not go live until publish, but there is no explicit when-to-use guidance. Nothing tells the agent when to prefer this over edit_files, write_page, or upload_asset, so routing must be inferred from the extension list.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources