Skip to main content
Glama

File write

write_file
DestructiveIdempotent

Writes UTF-8 text to a file in the sandboxed workspace, creating parent directories and overwriting existing files so you can persist reports or working notes.

Instructions

Write UTF-8 text to a file inside the sandboxed workspace directory (creates parent directories; overwrites existing files). Use it to persist the final report or working notes.

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
pathYesDestination path relative to the sandbox, e.g. reports/out.md
contentYesUTF-8 text to write

Output Schema

NameRequiredDescriptionDefault
dataYes
statusNook

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, and idempotentHint=true. The description reinforces the destructive behavior by noting that it "overwrites existing files" and adds useful operational context that parent directories are created automatically and the workspace is sandboxed.

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 sentences, front-loaded with the core action and scope, followed by a concise usage note. Every sentence adds value with no 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?

With annotations covering safety and idempotency, an output schema present, and full schema description coverage, the description supplies everything an agent needs: sandbox scope, overwrite behavior, automatic directory creation, encoding, and a usage example.

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 description coverage is 100%, so both parameters are already documented in the input schema. The description adds minor context about UTF-8 encoding and sandbox scoping, but mostly restates what the schema already provides, so the baseline of 3 is appropriate.

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 states a specific verb and resource ("Write UTF-8 text to a file") and scopes it precisely to the "sandboxed workspace directory." It is clearly distinguishable from the sibling read_file tool by describing a write operation, not a read operation.

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 provides a clear usage context: "Use it to persist the final report or working notes." It does not explicitly say when not to use it or name alternatives, but the writing use case is unambiguous and there is no competing sibling write tool.

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