Skip to main content
Glama

Write a file

rent_write_file
DestructiveIdempotent

Writes a file in a running sandbox, creating parent directories and replacing what is there. content is UTF-8 text, or base64 with encoding base64.

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": "rent_write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes
encodingNoutf-8
sandbox_idYesSandbox id (`lse_…`) from rent_create_sandbox or rent_list_sandboxes. It names the sandbox for its whole life and keeps answering rent_get_sandbox, with the final state, after it ends.

Output Schema

NameRequiredDescriptionDefault
modeYes
nameYes
pathYes
sizeYes
typeYes
modified_atYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and openWorldHint=true, but the description adds genuinely new behavior: parent directories are auto-created and existing content is overwritten. It still omits size limits, error behavior, and whether the sandbox must be running versus paused.

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 core write/overwrite behavior, with the encoding caveat appended where it belongs. No filler.

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?

With rich annotations and an output schema present, the description covers the destructive overwrite and encoding contract, which is the critical information. Remaining gaps (path resolution, size limits, sandbox state requirements) are modest for a single-file write tool.

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 25% (sandbox_id alone is documented), so the description must compensate – and it does for two parameters, explaining that 'content' is UTF-8 text by default or base64 when 'encoding' is set to base64. The 'path' parameter's semantics (relative vs absolute, root) remain unaddressed.

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?

States a specific verb and resource ('Writes a file in a running sandbox') plus scope details: parent directories are created and existing content is replaced. An agent can distinguish it from rent_read_file by the write semantics, though rent_read_file is never named explicitly.

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?

Usage is only implied by the phrase 'in a running sandbox' – the agent must infer the sandbox must exist and be running. No explicit when-to-use/when-not-to-use guidance versus alternatives like rent_exec or rent_run_code for creating files.

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