Skip to main content
Glama

Edit commander file

exza_edit_commander_file
Destructive

Replace one exact text span in an authorized source file guarded by expectedSha256. Unlike exza_append_commander_file this modifies existing text rather than adding at end. Requires account-bound computer:write OAuth and any prompted local owner approval.

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>",
      "oldText": "<oldText>",
      "newText": "<newText>",
      "expectedSha256": "<expectedSha256>"
    },
    "name": "exza_edit_commander_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesExplicit path inside the scope for this tool; no symlink traversal where prohibited.
newTextYesReplacement text for the exact matching span.
oldTextYesText span that must occur uniquely before a guarded edit.
expectedSha256YesLowercase SHA-256 from the prior read; prevents overwriting changed content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is covered; the description earns credit for adding the account-bound computer:write OAuth requirement and the possibility of an interactive local owner approval prompt, which are behavioral facts absent from annotations. It stops short of describing what happens on a SHA mismatch or a non-unique match, which matters for a destructive edit.

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?

Three sentences, front-loaded with the operation and the guard, with no filler. The final sentence packing two separate requirements (OAuth scope and approval prompt) into one clause is slightly compressed but still readable.

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?

For a destructive single-span edit with no output schema, the definition covers scope, guard, permissions, and the sibling distinction. The remaining gap is failure behavior (SHA mismatch, ambiguous match) and return shape, which the schema does not supply either.

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 four parameters are already documented, including expectedSha256's guard role and oldText's uniqueness requirement. The description reinforces the guard with 'guarded by expectedSha256' and the single-span constraint but adds no syntax, formatting, or matching rules beyond the schema, so the 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?

The description opens with a specific verb and resource: 'Replace one exact text span in an authorized source file,' and immediately names the sibling it differs from (exza_append_commander_file). An agent can distinguish this mutation from append-style writes 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 Guidelines4/5

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

It gives a clear contrast case with the append sibling ('modifies existing text rather than adding at end') and states the precondition of an exact unique span plus OAuth scope. It does not route between other plausible alternatives such as exza_edit_home_text or exza_write_authorized_file, so the when-not guidance is partial.

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