Skip to main content
Glama

apply_edits

Atomically apply a batch of edits to a file, rolling back on any failure. Use to safely land a planned sequence of changes.

Instructions

Atomic batch: open once → apply ops → lint → save once. Opens an internal transaction against path, dispatches each {tool, args} op through the JSON-RPC tools/call path with transaction_id injected, and commits at the end. On any op failure or lint-error at commit, rolls back — disk is byte-identical to its pre-call state. Compare with dry_run_edit (clones to tempfile, never touches the real file): use dry_run_edit to preview a plan, apply_edits to land it. Returns {applied: [{tool, ok, result|error}], verify, committed}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opsYesOrdered list of tool calls to apply atomically.
pathYes
Behavior4/5

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

Despite no annotations, the description details transactional behavior: opens internal transaction, dispatches ops via JSON-RPC, and rolls back on failure, ensuring disk byte-identical. It also mentions lint-check at commit. Missing permissions but strong for complexity.

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?

Extremely concise: opens with summary, explains process, compares with sibling, and returns output format—all in few sentences with no fluff.

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?

Given complexity (atomic batch, rollback, no output schema), the description covers process, rollback guarantee, and return format. Lacks details on error handling for missing paths or permissions, but adequate overall.

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 description coverage is 50%; the description adds meaning: explains ops as ordered list dispatched with transaction_id, and path implied as file path. Adds valuable context beyond schema.

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: 'Atomic batch: open once → apply ops → lint → save once.' It specifies the action (apply edits atomically) and the resource (path), and distinguishes from dry_run_edit.

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?

Explicitly compares with dry_run_edit: 'use dry_run_edit to preview a plan, apply_edits to land it,' providing clear guidance on when to use each tool.

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

Install Server

Other Tools

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/mafaq229/pbirb-mcp'

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