Skip to main content
Glama

Write file

write_file
Destructive

Create or replace a file with the full content. Saved at once; the preview updates.

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

Input Schema

NameRequiredDescriptionDefault
pathYesA path inside the project, such as index.html or js/game.js.
contentYes
project_idYesThe project's id, from list_projects or create_project.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, so safety is covered; the description adds genuinely new behavior: the write is committed at once (no draft/staging state) and the preview reflects it immediately. It does not cover failure modes such as overwriting an existing file without warning or missing parent directories, which keeps it short of a 5.

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 tight sentences, front-loaded with the operation and scope (create or replace, full content) followed by persistence behavior. No filler and nothing buried.

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 simple three-parameter write tool with no output schema and annotations already covering the destructive profile, the description supplies the essentials: what is written, that it replaces existing content, and that it persists immediately. Minor gaps around overwrite confirmation and error handling are acceptable at this complexity.

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 67%: path and project_id are documented in the schema, while content is a bare string. The phrase "the full content" clarifies that content is the complete file body, not a patch or fragment, which adds real meaning beyond the schema, but nothing elaborates on path constraints or overwrite semantics.

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 names a specific verb pair and resource ("Create or replace a file") and scopes it to full-content writes. It does not, however, name or contrast with the obvious sibling edit_file, so an agent must infer that partial edits belong elsewhere.

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?

"with the full content" implicitly signals this is for whole-file writes rather than incremental edits, which is the key selection criterion against edit_file. That guidance is only implied; there is no explicit when-to-use or when-not-to-use statement.

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