Skip to main content
Glama

Write file

code_write
Destructive

Create a file or replace it whole. Returns the change and the tree's problems after it. To change part of a file, use code_edit.

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>",
      "org": "<org>"
    },
    "name": "code_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgYesslug of the organization whose trees and sites to use. Required on every call, even when only one organization is listed; a path never names it.
pathYesThe file's address, <tree>:<path>.
contentYesThe whole text of the file.
messageNoA brief note on the change.
ifRevisionNoThe revisionId returned by code_read; refuse unless the file is still at it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, but the description adds real context beyond them: replacement is whole-file (existing content is lost, not merged) and the call returns both the change and the tree's post-change problems. It omits mention of the ifRevision optimistic-concurrency guard, though the schema covers that.

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?

Three short sentences, front-loaded with the core action, then return behavior, then the sibling routing rule. 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?

There is no output schema, and the description does address what comes back (the change and tree problems), plus it marks the destructive whole-file semantics. A brief note on revision safety/conflict behavior would make it fully complete, but the essentials are present.

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%, so all five parameters including ifRevision and org are already documented. The description only implies that 'content' is the complete file body via 'replace it whole', adding little beyond the schema; baseline 3 applies.

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 ('Create a file or replace it whole') and explicitly distinguishes itself from the sibling code_edit by scope of change. An agent can pick between the two without opening either 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 an explicit routing rule: whole-file creation/replacement here, partial changes via code_edit. That is a when-to-use and a when-not-to-use in one sentence.

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