Skip to main content
Glama

regex_replace

Replace text matching a regular expression pattern with a specified replacement string. Supports flags for case-insensitive, multiline, and dotall matching.

Instructions

Replace text matching a regular expression.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to process
patternYesRegular expression pattern to match
replacementYesReplacement string
flagsNoRegex flags (i=ignorecase, m=multiline, s=dotall)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as whether the operation is destructive, any side effects, or input/output limitations. It only states what it does without additional context.

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 one short sentence, which is extremely concise. However, it could benefit from a bit more detail without becoming verbose. Still, it is efficient and front-loaded.

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 that there is an output schema (context indicates 'Has output schema: true'), the description does not need to explain return values. The tool is simple and the description covers the core functionality sufficiently.

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% description coverage, so the schema already documents each parameter. The description adds no extra meaning beyond the schema, which is adequate but not improved upon.

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 replaces text using a regular expression. It specifies a specific verb ('Replace') and resource ('text matching a regular expression'), and it distinguishes itself from similar siblings like 'regex_match' which likely only matches without replacing.

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 such as 'regex_match' or other text manipulation tools. The context siblings include 'regex_match', but the description does not mention when to choose this one over others.

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/quyansiyuanwang/oh-my-mcp'

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