Skip to main content
Glama

apply_codemod

Apply bulk regex find-and-replace across files to automate mechanical code changes like updating imports, renaming patterns, or adding async/await. Preview changes first, then apply them.

Instructions

Bulk regex find-and-replace across files. Dry-run by default — first call shows preview, second call with dry_run=false applies. Use for mechanical changes like adding async/await, renaming patterns, updating imports across many files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesRegex pattern to match (JavaScript regex syntax)
replacementYesReplacement string ($1, $2 for capture groups)
file_patternYesGlob pattern for files to scan (e.g. "tests/**/*.test.ts", "src/**/*.py")
dry_runNoPreview changes without writing (default: true). Set to false to apply.
confirm_largeNoRequired when >20 files affected. Acknowledges large-scale change.
filter_contentNoOnly process files containing this substring (narrows scope)
multilineNoEnable multiline mode (dot matches newlines, patterns span lines)
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behaviors: the two-step dry-run/apply process, default settings (dry_run=true), and use cases. It could improve by mentioning potential risks (e.g., data loss) or output format, but it's largely transparent.

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?

It is front-loaded with the core purpose, followed by operational details and examples, all in three efficient sentences with zero wasted words, making it easy to parse quickly.

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?

Given the tool's complexity (7 parameters, no annotations, no output schema), the description is mostly complete: it explains the tool's function, usage flow, and examples. It could be more complete by detailing output or error handling, but it covers essential context well.

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 already documents all parameters thoroughly. The description adds minimal param-specific semantics (e.g., implies 'dry_run' behavior), but doesn't significantly enhance understanding beyond the schema, warranting the baseline score.

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?

The description clearly states the tool's purpose with specific verbs ('bulk regex find-and-replace across files') and distinguishes it from siblings by specifying its mechanical change focus (e.g., 'adding async/await, renaming patterns, updating imports'), unlike more analytical or planning tools in the sibling list.

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?

It provides explicit usage guidance: 'Dry-run by default — first call shows preview, second call with dry_run=false applies' and 'Use for mechanical changes like...', giving clear when-to-use instructions and operational steps, with no misleading or missing 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/nikolai-vysotskyi/trace-mcp'

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