Skip to main content
Glama

code.write

Create or overwrite UTF-8 text files at relative paths in the workspace sandbox, with optional overwrite control for writing code or config.

Instructions

Create or overwrite a text file inside the workspace sandbox.

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": "code.write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesRelative file path.
contentYesUTF-8 text content.
overwriteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two useful traits: writes are confined to the workspace sandbox and existing files can be overwritten. It omits what happens when the target exists and overwrite is false, whether parent directories are created, and what is returned, which matters for a mutation tool.

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?

A single front-loaded sentence with no filler or redundancy. Brevity is a virtue here, though it shades into under-specification rather than crisp completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a write/mutation tool with no annotations and no output schema, the definition should address error behavior on existing files, directory creation, and the result of the call. None of that is present, leaving real ambiguity for an agent about to perform a destructive-capable operation.

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 coverage is 67%: path and content are self-documented, while overwrite is only implied by the verb 'overwrite' in the description. That hint adds marginal meaning but does not explain the flag's default-false semantics or the resulting failure mode, so it sits at baseline.

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?

The description states a specific verb pair (create/overwrite) and resource (text file) plus a scope qualifier (inside the workspace sandbox), which lets an agent distinguish it from code.run and code.scaffold. It stops short of explicitly naming or contrasting a sibling, so it is clear but not fully differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this instead of code.scaffold or another writing path, nor any stated preconditions beyond the sandbox boundary. The agent must infer the choice from the verb alone.

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