Skip to main content
Glama

find_and_replace

Search and replace text across multiple files with preview capability to review changes before applying them.

Instructions

Find and replace text across multiple files with preview option

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchPatternYesText or regex pattern to search for
replacementYesReplacement text
filesNoSpecific files to process
filePatternNoFile pattern to match (e.g., "**/*.ts")
regexNoTreat search pattern as regex
caseSensitiveNoCase sensitive search (default: true)
wholeWordNoMatch whole words only
previewNoPreview changes without applying them
backupNoCreate backup files before changes
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions a 'preview option', it doesn't describe what happens during preview versus actual replacement, whether changes are destructive or reversible, or any permissions/rate limits. For a tool that modifies files, this lack of safety and operational context is a significant gap.

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?

The description is a single, efficient sentence that front-loads the core functionality ('Find and replace text across multiple files') and includes a key feature ('with preview option'). Every word earns its place, with no redundancy or unnecessary elaboration.

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?

Given the tool's complexity (9 parameters, file modifications) and lack of annotations or output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., success status, changed files list), error conditions, or behavioral details like whether backups are created by default. For a mutation tool with rich parameters, more context is needed.

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 fully documents all 9 parameters. The description adds minimal value beyond the schema, only implying that parameters support 'multiple files' and a 'preview option' (which maps to the 'preview' parameter). Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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?

The description clearly states the tool's purpose: 'Find and replace text across multiple files with preview option'. It specifies the verb ('find and replace'), resource ('text across multiple files'), and a key feature ('preview option'). However, it doesn't explicitly differentiate from sibling tools like 'preview_changes' or 'search_code', which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose it over sibling tools like 'search_code' (for searching without replacement) or 'preview_changes' (for previewing changes from other operations). There's also no mention of prerequisites or constraints, leaving usage context unclear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/block/vscode-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server