Skip to main content
Glama
Majrooo

majrooo-mcp-devkit

by Majrooo

batch_apply_edits

Destructive

Apply multiple file edits with validation and partial rollback on failure. Preview changes via dryRun before writing.

Instructions

Apply multiple file edits with partial rollback on failure. Validates all edits first — if validation fails, response says explicitly how many edits were applied and which files were written/reverted (NO files are modified). On failure during application, only the failed edit and later edits are reverted; earlier successful edits are preserved. Every response includes message, appliedEdits, written, and per-preview-entry applied. Use dryRun: true (default) to preview changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking dir for resolving relative file paths (default: primary project root)
editsYesList of edits to apply
dryRunNoPreview all changes without writing (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.1
    • addedInput schema / properties / edits / items / properties / excludePatterns
      Added value: +{
      +  "description": "Patterns to exclude from replaceAll (e.g. '#[cfg(test)]' to skip test modules)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changedv0.1.1
    • addedInput schema / properties / cwd
      Added value: +{
      +  "description": "Working dir for resolving relative file paths (default: primary project root)",
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

The description goes far beyond the annotations. Annotations indicate destructiveHint=true and readOnlyHint=false, but the description details the exact rollback semantics: validation failure means no files modified, and on application failure only the failed and later edits are reverted, preserving earlier ones. It also specifies the response structure (message, appliedEdits, written, per-preview applied). This is comprehensive behavioral disclosure.

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?

The description is concise yet information-dense. Each sentence adds critical information: the core behavior, validation guarantee, rollback specifics, response fields, and dryRun default. It is front-loaded with the main purpose and uses no fluff or redundancy.

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 tool with this complexity (multiple edits, validation, partial rollback, dry run), the description covers all essential aspects an agent needs: validation outcomes, failure behavior, success preservation, response format, and dryRun default. No output schema exists, so describing the response fields is necessary and well done. Nothing critical is missing.

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 the schema already documents all three parameters (cwd, edits, dryRun) with detailed descriptions. The tool description does not add extra meaning beyond what the schema provides; it mentions dryRun but without new details. Per the rubric, baseline 3 is appropriate when schema carries the parameter documentation.

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 clearly states the tool's purpose: 'Apply multiple file edits with partial rollback on failure.' It specifies the verb (apply), resource (multiple file edits), and key behavioral nuance (partial rollback). This is specific and distinguishes it from sibling tools like run_destructive_command, which focus on command execution rather than file editing.

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?

The description provides clear usage context by explaining when to use dryRun: 'Use dryRun: true (default) to preview changes.' It also describes the validation-first behavior, implying when to rely on the tool for safe multi-edit operations. However, it does not explicitly contrast with alternative tools or state when not to use it, so it lacks explicit exclusions.

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