Skip to main content
Glama

find_and_replace

Search and replace text across multiple files using regex or plain text. Preview changes before applying, with options for case sensitivity, whole words, and automatic backup.

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?

The description mentions the preview option but does not disclose the destructive nature of replacement, required permissions, or side effects. Without annotations, the description carries the full burden and falls short.

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 description is a single clear sentence with no fluff. It is efficient but could include slightly more detail without harming conciseness.

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 9 parameters, no output schema, and no annotations, the description is too brief. It does not explain return values, file selection logic (files vs filePattern), or behavior defaults.

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?

The input schema has 100% coverage with descriptions for all 9 parameters. The tool description adds no extra meaning beyond the schema, achieving the baseline for high coverage.

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 verb (find and replace), resource (text across multiple files), and a notable feature (preview option). It distinguishes itself from simpler tools like write_file, but does not explicitly contrast with similar siblings like 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 Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives (e.g., apply_patch or preview_changes), nor are prerequisites or exclusions mentioned. The description lacks usage context.

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/agentics-ai/code-mcp'

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