Skip to main content
Glama
Codepage Bridge MCP

Codepage Bridge MCP

by skyispainted

Performs exact string replacements in files.

Edit

Replace exact strings in files to update code or text while preserving indentation and encoding; use replace_all to change every occurrence.

Instructions

Performs exact string replacements in files.

Usage:

  • You must use your Read tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.

  • When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: line number + tab. Everything after that is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.

  • ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.

  • Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.

  • The edit will FAIL if old_string is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use replace_all to change every instance of old_string.

  • Use replace_all for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.

  • Line endings are handled for you: old_string and new_string may use either LF or CRLF, and the file keeps its own style on disk. Never inspect or rewrite a file just to fix line endings.

  • The success message states the encoding and line endings that were preserved. That is authoritative; no follow-up read or shell check is needed.

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": {
      "file_path": "<file_path>",
      "old_string": "<old_string>",
      "new_string": "<new_string>"
    },
    "name": "Edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_pathYesThe absolute path to the file to modify
new_stringYesThe text to replace it with (must be different from old_string)
old_stringYesThe text to replace
replace_allNoReplace all occurrences of old_string (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the hard failure mode when old_string is non-unique, the Read-before-edit prerequisite, automatic LF/CRLF normalization that preserves the file's on-disk style, and that the success message reporting encoding and line endings is authoritative so no verification read is needed.

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?

Bulleted and front-loaded with the prerequisite first, and each bullet addresses a distinct failure mode rather than restating the schema. A few clauses are slightly verbose (the emoji bullet and the 'authoritative' sentence), but none are wasteful enough to obscure the key rules.

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

Completeness5/5

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

No output schema exists, yet the description explains what the success message reports and that it is authoritative, and it preempts the main agent failure modes (missing Read, non-unique match, stray line-number prefixes, line-ending churn). Nothing needed to invoke this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: old_string must be unique or the call fails, replace_all exists specifically for renames and multi-instance edits, the line-number-plus-tab prefix from Read output must never be included, and both strings may use either line-ending style.

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?

"Performs exact string replacements in files" names a concrete verb (replace) and resource (file contents) and the guidance to prefer editing existing files over writing new ones implicitly separates it from the Write sibling. It stops short of explicitly naming Write/Grep as alternatives, so sibling differentiation is present but indirect.

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

Usage Guidelines5/5

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

Explicit prerequisites (must call Read first or the tool errors), a clear preference rule (edit existing files, never create new ones unless required), and a decision rule for choosing replace_all versus a larger unique old_string. When-to-use and when-not-to-use are both covered.

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