Skip to main content
Glama

find_and_replace_in_scripts

Destructive

Replace plain text across every script in a place at once for codebase-wide renames. Run with dryRun true first to preview affected scripts and match counts before overwriting.

Instructions

Replace a piece of plain text in every script of the place at once, for renames across the codebase. Overwrites every match in every script. Run with dryRun true first to see which scripts and how many matches would change. For changes inside one script use patch_script.

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": {
      "find": "<find>",
      "replace": "<replace>"
    },
    "name": "find_and_replace_in_scripts"
  }
}

Input Schema

NameRequiredDescriptionDefault
findYesPlain text to find (not a pattern)
placeNoTarget place (PlaceId or project name). Defaults to the bound/sole connected place.
dryRunNoList what would change without writing anything. Default false.
replaceYesReplacement text

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.1
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview only; don't modify (default false)"New value: +"List what would change without writing anything. Default false."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is known; the description adds real value with blast radius ('Overwrites every match in every script') and a preview-then-write procedure. It stops short of saying what happens on zero matches or whether the write is atomic, which keeps it from a 5.

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, zero filler, ordered from what it does to the danger to the alternative. The destructive scope sentence is front-loaded where it matters most.

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?

With no output schema, the description does describe what dryRun returns ('which scripts and how many matches would change'), covering the preview case usefully. It is silent on the return value of a real (non-dry) run, which is a minor remaining gap for a bulk mutation tool.

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 100%, so all four parameters (including find-as-plain-text and dryRun's default) are already documented structurally. The description reinforces dryRun's purpose and the plain-text nature of the match, but adds no syntax or format 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.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Replace a piece of plain text in every script of the place') plus the scope ('at once') and the intended use case ('renames across the codebase'). It also explicitly contrasts with the sibling patch_script, so the agent can distinguish the bulk-replace tool from the single-script tool without opening either schema.

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?

Gives an explicit recommended workflow ('Run with dryRun true first') and an explicit routing rule ('For changes inside one script use patch_script'). Both the when-to-use and the alternative are spelled out rather than implied.

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