Skip to main content
Glama

edit

Edit a text file by exact string replacement, cheaper than read + write for small changes. Each old_str must be literal text matching exactly once (set replace_all for every occurrence). Edits apply in order and commit atomically as one new version; on STRING_NOT_FOUND check the hint for whitespace mismatches. Text files up to 16 MiB. Pass expected_version to fail instead of overwriting concurrent changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile to edit, relative to the workspace root. Must already exist.
editsYesUp to 20 replacements, applied in order and committed together as one new version.
workspaceNoWorkspace slug. Optional, defaults to "temp".
override_lockNoEdit even if another agent holds a lock on this path. Recorded in the activity log.
expected_versionNoFail with VERSION_CONFLICT unless the file is currently at this version. Omit for last-write-wins.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false etc.), the description richly discloses behavioral details: exact matching requirements, ordering and atomicity of edits, error behavior (STRING_NOT_FOUND with whitespace hint), file size limit, and versioning/concurrency behavior. This significantly exceeds the minimal annotation information and provides critical operational context.

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 exceptionally concise yet information-dense: four sentences covering purpose, matching semantics, ordering, atomicity, error handling, size limits, and concurrency. Every sentence earns its place with no filler or redundancy, and the core purpose is front-loaded.

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?

Despite having no output schema, the description covers all critical aspects for successful invocation: exact match requirements, replace_all usage, ordered/atomic commits, error recovery hints, size limits, and optimistic concurrency. It also references relevant failure modes and provides sufficient context to use the tool correctly without requiring additional documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While the schema provides 100% coverage of parameter definitions, the description adds substantial meaning beyond these structured fields: it clarifies that old_str must match exactly once unless replace_all is set, explains the order and atomicity of multiple edits, and elaborates on expected_version's role in failing on concurrent changes. This adds real value beyond the 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 identifies the tool's function: 'Edit a text file by exact string replacement.' It specifies a unique verb ('edit') and resource ('text file') and distinguishes it from read/write operations by framing it as a cheaper alternative for small changes, which differentiates it from sibling tools like write.

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 strong context for usage, indicating it is 'cheaper than read + write for small changes' and explains when to use expected_version for concurrency. However, it does not explicitly state when not to use it or mention alternatives beyond read/write, such as for large-scale edits, which would fully clarify selection among siblings.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.