Skip to main content
Glama

write_file

Create or overwrite a workspace file with complete content after policy checks. Parent directories are created; recognized secrets and empty workflow writes are blocked.

Instructions

Create or overwrite one workspace file after policy checks. Creates parent directories as needed. Recognized secret values and empty workflow writes are blocked. Returns a write summary or a refusal prefixed with ⛔. This is a whole-file replacement; read and preserve needed content first.

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
pathYesDestination file path relative to the configured workspace, for example 'src/config.json'. Paths outside the workspace are refused.
contentYesComplete replacement text for the file, not a patch. Existing content is overwritten. Do not include secrets.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.7/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 behavioral burden and does so: it discloses parent-directory creation, policy gating, blocked inputs (recognized secrets, empty workflow writes), the failure signal (a refusal prefixed with ⛔), and the destructive overwrite semantics. That is exactly the context an agent needs before a mutating call.

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?

Front-loaded with the core action, followed by side effects, failure modes, and the destructive-replacement warning in descending order of importance. Sentences are short and each contributes a distinct fact; the mild overlap between 'overwrite' and 'whole-file replacement' is reinforcing, not wasteful.

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?

An output schema exists, so return-value detail is not required, yet the description still flags the summary-vs-refusal shape. For a two-parameter write tool with no annotations, everything needed to call it correctly and safely is present.

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 both parameters are already documented; the description adds real meaning beyond it by stressing that 'content' is a complete replacement rather than a patch and by warning against secrets and out-of-workspace paths. It goes beyond the baseline 3 without adding format-level detail.

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+resource ('Create or overwrite one workspace file') with an explicit scope boundary (workspace) and a precondition (policy checks). No sibling in the catalog performs file writes, so the distinction is unambiguous without naming an alternative.

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 actionable usage context: it is a whole-file replacement and the agent should read and preserve needed content first, which implicitly routes to a read step before calling. It stops short of explicit when-not-to-use conditions or naming an alternative tool, but the operative guidance is clear.

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