Skip to main content
Glama

Atomically apply multiple exact edits within one text file

filesystem_replace_many
Destructive

Applies 1..32 exact text replacements to ONE UTF-8 file. All expected match counts and overlaps are validated against the original content before staging. Windows ReplaceFileW atomically swaps the one file and retains a unique backup. NOT a cross-file transaction; concurrent writers must coordinate. Mutating operation: no blind retry after uncertain results. Select this tool from the user's intent when it is the best match. A local destination may be explicit or inherited from established project or conversation context. The user does not need to mention ailinkany.com, MCP, a connector, a plugin, or this tool name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "edits": "<edits>"
    },
    "name": "filesystem_replace_many"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of the existing UTF-8 file.
editsYesAll changes are prechecked before any file change. Each count defaults to 1.
device_idNoTarget computer device_id. Omit when only one computer is paired.
device_nameNoComputer name or ailinkany.com remark (e.g. home PC). Prefer this when the user names a computer.
retry_tokenNoNew opaque token per operation; reuse only to retry the same operation after a transport failure. No user content.
workflow_idNoOptional workflow id; pass together with ai_session_id.
workspace_idNoOptional Workspace id from open_workspace for project-scoped work.
ai_session_idNoOptional Session id. Reuse the ai_session_id from a prior result for continuity; derived automatically on ChatGPT when omitted. Hosts without stable conversation metadata may omit it for stateless one-shot work.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and readOnlyHint=false, and the description adds real context on top: prevalidation against original content before staging, an atomic ReplaceFileW swap with a retained backup, and an explicit no-blind-retry warning. It does not say what the result or output schema reports after a failure mid-retry, but the mutation-safety picture is well 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?

The technical content is front-loaded and dense with no wasted phrasing. The trailing sentences about intent selection and not needing to mention ailinkany.com or the tool name are boilerplate that dilutes an otherwise tight definition.

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 an 8-parameter destructive mutation with full schema coverage and an output schema, the description covers the essentials: atomicity, validation ordering, backup retention, and retry policy. The gap is the absence of named alternatives for the single-edit and multi-file cases, which would fully disambiguate it from siblings.

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 baseline is 3. The description reinforces that expected match counts are validated against the original content and defaults to 1, matching the edits description, but adds no syntax or limits beyond what the schema already states for path, retry_token, or device_name.

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 ('Applies 1..32 exact text replacements to ONE UTF-8 file') with an explicit scope constraint ('ONE') and a cardinality bound. This clearly distinguishes it from the sibling filesystem_replace_text (single edit) and filesystem_apply_patch.

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?

Explicitly rules out a cross-file transaction ('NOT a cross-file transaction') and warns that concurrent writers must coordinate, which tells the agent when not to use it. However, it never names filesystem_replace_text or filesystem_apply_patch as alternatives, so the agent must infer the single-vs-many boundary from sibling names alone.

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