Skip to main content
Glama
Bridge Commander
by PaPasha215

edit_block

Destructive

Replace exact text in a file when you need a precise, verifiable edit. Specify the target string, its replacement, and how many matches to expect.

Instructions

Replace exact text in a file. old_string must match exactly and occur expected_replacements times (default 1). Include enough context to make it unique.

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_block"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_pathYes
new_stringYes
old_stringYes
expected_replacementsNo

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?

Annotations already declare destructiveHint=true and idempotentHint=false, so the risk profile is covered structurally. The description adds real behavioral value beyond that: the match must be exact, must occur a specific number of times, and defaults to exactly one occurrence — which tells the agent the call fails rather than silently editing on ambiguity. It omits whether a failed match leaves the file untouched and says nothing about encoding or return content.

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?

Three short sentences, front-loaded with the action, then the two constraints that actually affect how the agent must build the call. No filler, no restatement of the tool name.

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 a destructive mutation tool with no output schema, the definition covers the essential failure modes (non-unique or non-matching text). It would be stronger if it stated the outcome of a count mismatch and gave at least a hint of what the response contains, but nothing an agent needs to construct a correct call is missing.

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 0%, so the description must carry the load. It adequately explains the two non-obvious parameters (old_string's exact-match requirement and expected_replacements' default of 1) but says nothing about new_string or file_path semantics, and gives no example of what 'enough context' looks like in practice.

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: 'Replace exact text in a file.' An agent can immediately tell this is a targeted text substitution rather than a whole-file write (write_file) or a read. It stops short of naming or contrasting any sibling, so it does not earn a 5.

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?

The line 'Include enough context to make it unique' is genuine how-to guidance for constructing old_string, and the expected_replacements mention implies a safety check. However, there is no explicit when-to-use-this-vs-write_file guidance and no statement of what to do if the match count is wrong, leaving usage to inference.

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