Skip to main content
Glama

repo_write

DestructiveIdempotent

Create or completely overwrite a file in your local repo with full content, including parent directories. Requires a chatgpt/ branch, so start one first, then review changes with git_diff before pushing.

Instructions

Create or overwrite one file with the given full content (no patching or appending); parent directories are created. Refused unless the current branch starts with 'chatgpt/', so call branch_start first; the base branch is never written. Changes stay local and uncommitted until commit_push. Review them with git_diff.

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

Input Schema

NameRequiredDescriptionDefault
pathYesRepo-relative file path (e.g. 'src/app.py'). Paths escaping the repo root or under deny_paths are refused.
contentYesComplete new file content (UTF-8). Replaces the whole file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes well beyond them: it explains what is destroyed (whole-file replacement, not append), a side effect not captured by annotations (parent directories auto-created), an authorization gate tied to branch naming, and the lifecycle state after the call (local and uncommitted until commit_push). This is exactly the kind of context annotations cannot express.

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?

Four short sentences, each carrying a distinct fact: write semantics, precondition, base-branch safety, and post-call state. The most operationally important constraint (the full-content overwrite) is front-loaded, and nothing is redundant with the schema or annotations.

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 two-parameter mutation tool with no output schema, the description covers the safety profile, the prerequisite ordering with sibling tools, the residue state of the repo after the call, and the verification path. An agent has everything needed to invoke it correctly and to know what to do next.

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 100% and both parameters are documented in the schema, including the deny_paths escape restriction. The description reinforces content semantics ('given full content', 'no patching or appending') but adds no syntax, format, or constraint detail beyond what the schema already says, so the baseline of 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 pair (create or overwrite) on a specific resource (one file) and immediately bounds the semantics with 'no patching or appending'. That plus the branch-gating sentence distinguishes it from repo_read, commit_push, and git_diff without needing to open any 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 precondition ('Refused unless the current branch starts with chatgpt/, so call branch_start first'), an explicit exclusion ('the base branch is never written'), and a named follow-up alternative for verification ('Review them with git_diff'). The when-to-use and when-not-to-use cases are both spelled out.

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