Skip to main content
Glama

BCD — Bridge Control Delegate

write_file

Destructive

Create or replace a file; mode append adds to the end. .docx paths take Markdown; .xlsx/.xls/.xlsm take a JSON 2D array or an object of named sheets. The parent folder must exist (mode overwrite creates it). Rewrites are atomic. To change part of an existing file use edit_block; for PDFs use write_pdf. encoding base64 writes the decoded bytes as they are, for photos and other binary files (any extension); send a large one in parts with mode append, each part a multiple of 4 base64 characters, up to 20 MB.

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
modeNorewrite
pathYes
contentYes
deviceIdNoComputer name or id from list_devices. Optional with one computer online or a default set.
encodingNoutf8
workSessionIdNoWork session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / encoding
      Added value: +{
      +  "default": "utf8",
      +  "enum": [
      +    "utf8",
      +    "base64"
      +  ],
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / workSessionId
      Added value: +{
      +  "description": "Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work.",
      +  "format": "uuid",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the annotations (destructiveHint=true, which the description corroborates with "create or replace"). It discloses atomic rewrites, the parent-folder prerequisite, a 20 MB payload ceiling, and the multiple-of-4 base64 chunking rule for append. The one thin spot is that the distinction between the default rewrite and overwrite modes is only implied by the parent-folder clause.

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?

Dense but front-loaded: the core create/replace action comes first, then format rules, then sibling alternatives, then binary/size constraints. Every clause carries information, though cramming format rules into single long sentences makes it slightly harder to scan.

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 destructive 6-parameter write tool with 33% schema coverage and no output schema, the description covers formats, encodings, modes, atomicity and size limits — essentially everything needed to invoke it safely. Only the rewrite-vs-overwrite distinction and the return behavior are left unstated.

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 only 33% (deviceId and workSessionId are the documented params), so the description must carry the rest — and it does, explaining append semantics, overwrite's folder creation, and base64's byte-level behavior. It adds no explicit meaning for the 'rewrite' default versus 'overwrite', which is the remaining ambiguity.

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+resource ("Create or replace a file") and immediately extends it with format-specific behavior for .docx, .xlsx and base64 binaries. It explicitly names the siblings it is not (edit_block, write_pdf), so an agent can distinguish it without opening any 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?

Gives explicit routing: use edit_block to change part of an existing file, write_pdf for PDFs, and mode append for incremental writes. It also states a prerequisite (parent folder must exist, except with overwrite), which is the condition an agent needs to choose the mode correctly.

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