Skip to main content
Glama

Local Commander

Edit file text

fs_replace
DestructiveIdempotent

Use this when the user asks to change part of a file in an approved project: replaces exact text with new text. Changes files on the computer. Needs the sessionId from execution_session_open and a new operationId; each call is metered as one execution. A short result is returned inline within about two seconds; otherwise keep the returned IDs for operation_status and operation_output and do not resend the call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the selected project root (or the workspace root without a project target).
newTextYesReplacement text
oldTextYesExact text to replace
sessionIdYesexecutionSessionId returned by execution_session_open
deadlineAtNoOptional UTC admission deadline at most 60 seconds ahead (queue start timeout, NOT process execution lifetime)
replaceAllNoReplace every occurrence instead of exactly one (default false)
operationIdYesA new random UUID v4 for this call; reuse it only to retry this same call
expectedSha256NoSHA-256 of the current file; the edit is refused if the file changed (optional)
idempotencyKeyNoOptional retry key, 8-128 chars of [A-Za-z0-9._:-]; defaults to operationId
efficiencyProfileNoOptional, unverified label of the client's model, recorded as display metadata in the device owner's local activity statistics. Omit when unknown. Never send credentials or conversation content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, destructive, idempotent, non-open-world write. The description adds genuinely new operational context beyond that: metering (one execution per call), expected inline latency (~2 s), the async fallback via operation_status/operation_output, and the instruction not to resend. It omits failure behavior, such as what happens when oldText is absent or the edit is refused, so it falls short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, front-loaded with the triggering condition before mechanics, and the async/polling guidance comes last where it belongs. Dense but every sentence carries information; no 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 10-parameter destructive mutation with no output schema, the description covers the session/operation lifecycle, metering, latency, and the async-result contract, which is the key operational knowledge an agent needs. It leaves out error/refusal conditions and the direct-vs-async decision boundary, keeping it just under complete.

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 description coverage is 100%, so every parameter including oldText/newText/replaceAll/expectedSha256 is already documented in the schema, establishing the baseline of 3. The description only reinforces the origin of sessionId and the freshness of operationId, which the schema already states, so it adds little semantic value on top.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'replaces exact text with new text' inside a file, scoped to 'an approved project'. This is a precise sub-operation distinguishable from a whole-file write. However, it never names the obvious sibling fs_write or contrasts itself with it, so sibling differentiation is left to inference.

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?

Gives an explicit trigger condition ('Use this when the user asks to change part of a file in an approved project'), which frames it as a partial-edit tool. It stops short of stating when NOT to use it (e.g. whole-file writes via fs_write) or prerequisites like acquiring a session first, beyond the pointer to execution_session_open.

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.

Resources