Skip to main content
Glama

PillDrops

write_file

Write text content to a file in the sandbox workspace (path is relative to the workspace root; parent dirs are created). An absolute path is not re-rooted: one outside the workspace is refused, so use run_command to reach it.

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

Input Schema

NameRequiredDescriptionDefault
pathYesfile path relative to the workspace, e.g. app/main.py
contentYesfull file content
sandbox_idYessandbox id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It discloses useful behavior: parent directories are auto-created and out-of-workspace absolute paths are refused rather than re-rooted. However, for a write tool the most consequential behavior is unstated — whether an existing file is overwritten or truncated, and what happens on failure mid-write — which leaves a real gap.

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?

Two sentences, front-loaded with the core action and scope, then the path semantics and the escape hatch. Dense and mostly waste-free, though the clause 'An absolute path is not re-rooted: one outside the workspace is refused' is worded more convolutedly than needed.

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?

With no annotations and no output schema, the description must stand alone, and it covers scope, path resolution, and directory creation. It is still incomplete for a mutating tool: overwrite semantics, encoding/text-only constraints, and any return indication (bytes written, resulting path) are absent.

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 the baseline is 3, but the description adds genuine meaning beyond it: it clarifies that path is resolved against the workspace root and that absolute paths are not silently re-rooted but refused. Content is only implied to be the full file body, matching the schema.

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?

States a specific verb and resource ('Write text content to a file') plus the container scope ('sandbox workspace'), which cleanly separates it from read_file and from run_command. An agent knows immediately what this does without opening the schema.

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?

Gives concrete routing advice: paths outside the workspace are refused, so use run_command to reach them. That is an explicit alternative with its triggering condition. It stops short of full when/when-not coverage because it never says whether to prefer this over run_command for in-workspace writes or when to use an edit-style tool.

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.