Skip to main content
Glama

server_file_edit

Replace an exact, unique string in a text file to update content safely; set confirm=true to apply, with optional backup and replace-all support.

Instructions

Change part of a text file: replace old_string with new_string. Needs confirm=true.

old_string must match the file exactly and must be unique, unless replace_all=true. Works on files Claude can read. Lines with hidden secrets cannot be matched.

Input Schema

NameRequiredDescriptionDefault
hostNo
pathYes
backupNo
as_rootNo
confirmNo
new_stringYes
old_stringYes
replace_allNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose several non-obvious behaviors: confirm=true is mandatory, old_string must be exact and unique unless replace_all is set, and lines containing hidden secrets are unmatchable. It omits that backup defaults to true and that as_root can escalate privileges, so the mutation risk profile is only partially covered.

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?

Three short, front-loaded sentences with no filler; the confirm requirement and the matching constraints each earn their place. Breaking the constraints onto their own line aids scanning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutating 8-parameter tool with no annotations, the definition covers the core matching contract but leaves the side-effect surface thin: backup behavior, as_root privilege escalation and host targeting are never mentioned. An output schema exists, so return-value explanation is correctly omitted.

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 coverage is 0% across 8 parameters, so the description must compensate; it explains old_string, new_string, replace_all and confirm semantics well, but says nothing about backup, as_root, or host. Four of eight parameters remain undocumented anywhere.

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?

States a specific verb and resource ('Change part of a text file: replace old_string with new_string'), which clearly distinguishes it from the sibling server_file_write (whole-file overwrite) and server_file_read. An agent can select it without opening the schema.

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?

Implicitly scoped to partial edits and constrained to files the agent can read, plus a hidden-secrets caveat, but it never names server_file_write as the alternative or says when a full rewrite is preferable. Usage is inferable rather than stated.

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