Skip to main content
Glama

edit

Destructive

Modify files precisely by matching old text exactly, verifying expected revision, and returning the actual diff. Read first to ensure accuracy.

Instructions

Precisely edit a file using Pi's real edit implementation. All oldText entries match the original file. Read first and provide expected_revision; returns the actual diff.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path or path relative to the workspace. Home is a starting directory, not a sandbox.
editsYes
request_keyYesUnique operation key within this workspace. Reuse only for the exact same request; uncertain outcomes must not be blindly retried.
workspace_idYes
expected_revisionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false. The description adds value by explaining the edit is 'real' (not simulated), that oldText must match the original file, and that the tool returns the actual diff. It also implies the operation is not idempotent by requiring expected_revision. No contradiction with annotations.

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 sentences, each earning its place: what the tool does, the matching constraint, and the required workflow plus return value. No fluff, no repetition of schema details.

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 destructive, non-idempotent edit tool with no output schema, the description covers the key operational facts: read first, provide expected_revision, oldText must match, returns the diff. It doesn't explain what happens on mismatch or how the diff is formatted, but the core workflow is complete enough for an agent to call it correctly.

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 40%, so the description must compensate. It does: it explains expected_revision ('provide expected_revision'), clarifies oldText semantics ('All oldText entries match the original file'), and mentions the return value ('returns the actual diff'). The request_key semantics are only in the schema, but the description's guidance covers the most critical parameter behavior.

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 verb and resource: 'Precisely edit a file using Pi's real edit implementation.' It distinguishes itself from write (the sibling that creates/overwrites files) by emphasizing precise, oldText-matched edits. The phrase 'All oldText entries match the original file' clarifies the edit semantics.

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 gives clear usage guidance: 'Read first and provide expected_revision.' This tells the agent the prerequisite step and a required parameter. It doesn't explicitly name alternatives or when-not-to-use, but the sibling list (write, bash) and the edit-vs-write distinction are implied. The instruction to read first is concrete and actionable.

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