Skip to main content
Glama

Multi-file find/replace in one call

apply_edits
Destructive

Apply find/replace edits across MANY files in one tool call. Batch sibling of update_file_content. Per-file edit semantics identical (count: 1 default, -1 = all, positive int asserts exact count). Whole call is atomic across files: validation runs first, writes only proceed if every edit's count check passes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
filesYesFiles + edits to apply. Up to 25 files / 200 total edits per call. All-or-nothing: if any edit's match count differs from its expected count, NOTHING is written.
targetNoTree to edit, dist (default) or source. Same tree applies to every file in this call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
filesYes
siteIdYes
targetYes
warningsNoSecret-scanner findings in the rewritten files that did not block the call. Malicious content blocks the whole call with MALICIOUS_CONTENT instead.
totalEditsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedOutput schema / properties / request_id
      Removed value: -{
      -  "description": "Server-assigned request correlation id. Quote it when contacting support.",
      -  "type": "string"
      -}
  2. Changed1 schema field changed
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "description": "Secret-scanner findings in the rewritten files that did not block the call. Malicious content blocks the whole call with MALICIOUS_CONTENT instead.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "file": {
      +        "type": "string"
      +      },
      +      "line": {
      +        "type": "number"
      +      },
      +      "match": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "file",
      +      "line",
      +      "type",
      +      "match"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Changed1 schema field changed
    • addedOutput schema / properties / request_id
      Added value: +{
      +  "description": "Server-assigned request correlation id. Quote it when contacting support.",
      +  "type": "string"
      +}
  4. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses meaningful behavioral detail: atomicity across files, validation-first execution, writes only proceeding if every count check passes, and the semantics of count values. This is valuable context that annotations alone do not provide.

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 tightly packed sentences: scope, sibling relationship, count semantics, and atomic behavior. Every sentence earns its place and the most important batched-purpose information is front-loaded.

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

Completeness3/5

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

The description covers behavior, batching scope, and atomicity well, and an output schema exists. However, the required 'name' parameter is left completely undocumented both in the schema and in the description, leaving a real ambiguity about what value the agent must supply.

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

Parameters4/5

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

Schema coverage is 67%, and the description adds substantial parameter-level meaning: default count behavior, -1 meaning all, exact-match assertions, and the all-or-nothing nature of the call. The required 'name' parameter remains unexplained, but the description compensates well for most schema gaps.

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 states a specific action, 'Apply find/replace edits across MANY files in one tool call,' and identifies itself as the batch sibling of update_file_content, clearly differentiating its purpose from single-file alternatives.

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 explicitly names update_file_content as the sibling and frames this tool as the batch variant, making the primary usage context ('many files') clear. It stops short of explicitly stating when not to use it, but the guidance is strong enough for an agent to select appropriately.

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.