Skip to main content
Glama

apply_edits

Performs bounded literal or regex replacements inside SANDBOX_ROOT and returns changed files with replacement counts for mechanical edits.

Instructions

Zero-LLM mechanical edits: bounded literal or regex replacements inside SANDBOX_ROOT. Returns changed files and replacement counts.

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": {
      "edits": "<edits>"
    },
    "name": "apply_edits"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNo
editsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.5.0

TDQS

B3.4/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. It usefully discloses the sandbox boundary ('bounded ... inside SANDBOX_ROOT') and the return payload ('changed files and replacement counts'), but says nothing about atomicity, partial-failure behavior, whether writes are destructive or reversible, or any approval/permission requirement.

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?

Two tight sentences with zero filler. Scope and behavior are front-loaded, and the return contract is stated immediately after the action.

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 two-parameter mutation tool with no output schema, the description covers the essentials: what it does, where it operates, and what it returns. The notable gap is the nested `edits` semantics and the absence of any failure/atomicity statement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and largely does not. It hints at the literal-vs-regex distinction (the `regex` flag) but leaves `cwd`, `flags`, and especially `expected_replacements` — a semantically important count assertion — entirely unexplained.

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?

States a specific verb and resource ('literal or regex replacements') plus the scope constraint (inside SANDBOX_ROOT) and the 'zero-LLM mechanical' character, which meaningfully distinguishes it from drafting/LLM-style siblings. It does not explicitly name a sibling alternative, so it stops short of 5.

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

Usage Guidelines3/5

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

'Zero-LLM mechanical edits' implies the usage context: deterministic find-and-replace rather than generative editing. However, there is no explicit when-to-use/when-not-to-use statement and no named alternative for cases where the edit is not a simple literal or regex substitution.

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