Skip to main content
Glama

edit_batch

Apply multiple text edits to one file atomically, preview unified diffs with dry-run, and continue on partial failures. Use for batch modifications with validation.

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.

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