Skip to main content
Glama

replaceFileContent

Replace exact text within specified start and end lines of a file with new content, avoiding ambiguous matches.

Instructions

Surgically replace exact targetContent inside bounded lines [startLine, endLine].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endLineYesEnd line of search window.
startLineYesStart line of search window.
targetFileYesPath to target file.
instructionNoWhat this edit does.
allowMultipleNoAllow replacing multiple matches.
targetContentYesExact string to be replaced.
replacementContentYesNew string to insert.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden and falls short. It does not say what happens when targetContent is not found, when it matches multiple times (despite an allowMultiple parameter existing), whether the file must exist, or what the result looks like. Only the replacement mechanics are conveyed.

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?

A single front-loaded sentence with no padding; the core action and line-bounded scope come first. 'Surgically' is the only non-earning word, and the sentence is arguably too terse given the unimplemented behavioral gaps.

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

Completeness2/5

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

For a mutation tool with 7 parameters, no annotations and no output schema, the description omits the essential behavior around multiple matches, no-match/failure handling, and the two optional parameters (instruction, allowMultiple). An agent cannot confidently predict the outcome of a call from this text alone.

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 the schema already documents all seven parameters, including targetContent, startLine/endLine, allowMultiple and instruction. The description adds no syntax, format, or constraint detail beyond the schema; 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 (replace) on a specific resource (file content) and adds scope: exact targetContent, bounded by [startLine, endLine]. This implicitly separates it from writeToFile (wholesale write) and viewFile (read), though it never names those siblings. 'Surgically' is flavor rather than clarification.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance, and no alternative tool is named despite two close siblings (writeToFile for full rewrites, viewFile for reads). The bounded-window scope hints at targeted edits, but the agent must infer that replaceFileContent is preferred over writeToFile.

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