Skip to main content
Glama

write_file

Writes file content into a per-issue workspace for automated GitHub issue resolution, enforcing protected paths and per-issue write limits.

Instructions

Create or overwrite a file inside the workspace start_issue created for this issue. relative_path is checked the same way as read_file (no absolute/drive/UNC/'..'/'.git' paths) and is additionally checked against the fleet manifest's protected paths. Writes are capped per issue (default 5 attempts, configurable via SELF_DEV_MAX_ATTEMPTS); a refused write does not count against that cap. Returns "OK" on success, "REFUSED: ..." for a blocked path, "EXHAUSTED: ..." once the attempt cap is reached, or "ERROR: ..." for other failures -- never raises.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesFull text content to write to the file, replacing any existing content.
issue_numberYesThe issue number whose active workspace to write into; must have been started with start_issue first.
relative_pathYesPath to the file to write, relative to the issue workspace root. Absolute paths, drive letters, UNC paths, '..'-escaping paths, '.git' paths, and paths protected by the fleet manifest are refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.2
    • addedInput schema / properties / content / description
      Added value: +"Full text content to write to the file, replacing any existing content."
    • addedInput schema / properties / issue_number / description
      Added value: +"The issue number whose active workspace to write into; must have been started with start_issue first."
    • addedInput schema / properties / relative_path / description
      Added value: +"Path to the file to write, relative to the issue workspace root. Absolute paths, drive letters, UNC paths, '..'-escaping paths, '.git' paths, and paths protected by the fleet manifest are refused."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It fully discloses write caps (default 5, configurable), that refused writes don't count against the cap, and all possible return values ('OK', 'REFUSED', 'EXHAUSTED', 'ERROR') including the guarantee that it never raises. Path restrictions are also detailed.

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?

The description is three sentences, front-loaded with the core purpose, then path validation, then caps and return behavior. Every sentence adds unique value with no repetition or filler. The structure is logical and easy to parse.

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?

For a write tool with no output schema and no annotations, the description covers all essential operational aspects: what it does, how paths are validated, attempt limits, exact return values, and the guarantee of not raising exceptions. It also ties into start_issue as a prerequisite. Nothing critical is missing for an agent to call it correctly.

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% – all three parameters (content, issue_number, relative_path) are already described with sufficient detail in the schema. The description adds a cross-reference to read_file for relative_path validation and mentions the fleet manifest check, but these are essentially re-statements of schema content. It adds no new semantic meaning beyond the schema, so a baseline 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 action ('Create or overwrite a file') with a clear resource (file inside the issue workspace) and distinguishes itself from read_file by its write semantics. It also references the prerequisite start_issue, leaving no ambiguity about what the tool does.

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?

The description implies the tool is for writing files and references read_file for path-check consistency, but it does not explicitly state 'use this for writing, read_file for reading' or mention any exclusions. The start_issue prerequisite is noted, providing clear context, but alternatives are not spelled out.

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