Skip to main content
Glama

file_write

Create or overwrite a file by sending UTF-8 text or small base64 content directly in the tool call, and optionally allow unencrypted writes inside end-to-end encrypted folders.

Instructions

Create or overwrite a file from content you produce here: UTF-8 text in content, or small binary as base64 in content_base64. These bytes travel inside the tool call, so a file that already exists on YOUR disk - anything more than ~1 MB - must NOT be sent this way: call file_upload_ticket instead and stream it with curl. A path inside an end-to-end encrypted folder is refused with E2E_PLAINTEXT_REFUSED, because filex would store the bytes there unencrypted; set allow_plaintext only when that is what the person wants.

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>"
    },
    "name": "file_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesadapter://file path to create or overwrite
contentNoUTF-8 text content (use content_base64 for binary)
content_base64Nobase64-encoded binary content
allow_plaintextNoonly for a path inside an end-to-end encrypted folder: store the bytes there UNENCRYPTED on purpose (filex holds no key). Without it such a write fails with E2E_PLAINTEXT_REFUSED

Output Schema

NameRequiredDescriptionDefault
entryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses that writes overwrite, that bytes are transmitted inside the tool call with an implicit ~1 MB ceiling, and that encrypted-folder paths are refused with the exact error code E2E_PLAINTEXT_REFUSED. That error-code disclosure and the unencrypted-storage consequence of `allow_plaintext` are behavioral facts an agent could not infer from 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four dense sentences, front-loaded with the core action and content modes before the size limit and encryption caveat. Every sentence carries decision-relevant information; the E2E sentence is long but justifies its length with the error code and the consequence of the override flag.

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?

Return values need not be described because an output schema exists. For a four-parameter mutation tool with no annotations, the description covers the safety profile, size boundary, sibling routing, and the one failure mode an agent is likely to hit — enough to call it correctly on the first attempt.

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 baseline would be 3; the description earns more by explaining the choice between `content` and `content_base64` (text vs small binary) and by framing `allow_plaintext` as an intentional override tied to a specific failure mode. It stops short of format details such as base64 padding or path syntax, which the schema already covers.

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?

Opens with a specific verb and resource ('Create or overwrite a file') and immediately scopes it to content the caller produces, with the two content modes named. It explicitly contrasts itself with `file_upload_ticket`, so an agent can distinguish this tool from its closest sibling without reading either schema.

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?

States when to use this tool (small inline content, UTF-8 or small base64 binary) and when not to (anything on the caller's disk over ~1 MB), naming the alternative `file_upload_ticket` plus the mechanism (stream with curl). It also gives the precise condition that selects `allow_plaintext`, so both routing decisions are explicit.

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