Skip to main content
Glama
szkeli

Local Computer Bridge

by szkeli

Edit local file

edit
Destructive

Replace one exact text string in an existing local text file only when it occurs exactly once; if it is missing or duplicated, the operation fails.

Instructions

Make one exact targeted replacement in an existing local text file. old_text must occur exactly once; the call fails if it occurs zero times or more than once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the existing text file.
new_textYesReplacement text. May be empty to delete old_text.
old_textYesExact text that must occur exactly once.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
bytes_afterYes
bytes_beforeYes
replacementsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, so the safety profile is covered. The description adds genuinely new behavioral context: the call fails when old_text occurs zero times or more than once, which is the key failure mode an agent must handle.

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?

Two tight sentences, front-loaded with the operation and followed by the constraint. No filler and nothing that could be cut.

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?

With a full schema, an output schema, and annotations covering safety, the description only needs the failure semantics, which it supplies. Minor gaps remain: no mention of encoding/line-ending handling or what happens on partial-match ambiguity beyond the count rule.

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% and the schema already documents all three parameters, including old_text's exact-once requirement and new_text's empty-to-delete behavior. The description restates the uniqueness rule rather than adding format or encoding details, so baseline 3 applies.

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 (exact targeted replacement in an existing local text file) and the single-occurrence constraint, which implicitly separates it from whole-file 'write'. It never names the siblings read/write/bash, so an agent gets the operation but not an explicit routing statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: 'one exact targeted replacement' suggests preferring this over write when changing part of a file, but there is no explicit when-to-use, when-not-to-use, or alternative (e.g. use write for new files, bash for multi-edit operations).

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

Deploy Server

Other Tools