Skip to main content
Glama

edit_batch

Apply multiple edits to a single file in one atomic operation. Preview changes with dry_run before committing, and optionally apply successful edits even if some fail.

Instructions

MUST USE for all file edits. PREFERRED single-file edit path. Read first, then edit. Multiple edits, atomic, dry_run previews diff. Rollback/multi-file? edit_transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the file to edit, relative to workspace_dir (e.g. "src/auth.py")
editsYesArray of edits to apply. Example: [{"old_string": "foo", "new_string": "bar"}]
dry_runNoPreview changes as unified diff, do not apply
partialNoApply successful edits even if some fail (returns applied/failed indices)
verboseNoReturn original_content/final_content full text (default: false — diff only)
file_pathNoDEPRECATED: abs path alias, only inside workspace
workspace_dirNoREQUIRED: project root (abs). reindex first if new.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden. It discloses atomicity of multiple edits, dry-run preview capability, and the read-first requirement. However, it does not explicitly warn about file modification side effects or partial-failure behavior, though these are evident from the schema and the word 'edit'.

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 short, dense sentences that front-load the must-use directive and immediately capture purpose, usage, and alternatives. Every sentence earns its place with zero filler.

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 single-file edit tool with a detailed schema, the description covers the essential behavioral context: atomicity, dry-run preview, and the alternative path for other scenarios. It doesn't mention return values or partial-failure handling, but the schema fills those gaps, and the tool is relatively straightforward.

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%, so the schema already documents all parameters. The description adds minimal parameter-specific insight beyond the schema, mainly tying dry_run to diff preview and emphasizing atomic multi-edit behavior, but no new semantic details.

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 explicitly says 'MUST USE for all file edits' and 'PREFERRED single-file edit path', naming the resource (files) and the action (edit). It also distinguishes itself from edit_transaction, which is for rollback/multi-file scenarios, making it clear among siblings.

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?

It provides explicit when-to-use guidance ('MUST USE for all file edits'), a prerequisite ('Read first, then edit'), and names an alternative for other cases ('Rollback/multi-file? edit_transaction').

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wulun811/LiuHe'

If you have feedback or need assistance with the MCP directory API, please join our Discord server