Skip to main content
Glama

Does this regex match — and what does it capture?

regex_test
Read-onlyIdempotent

Runs a regular expression against sample text and returns every match with its position and capture groups (named groups included). Use before wiring a pattern into code, instead of guessing whether the escaping survived the trip through JSON and the shell.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text to test against.
flagsNoOptional flags, e.g. "gi". Default "g".
patternYesThe regular expression, without surrounding slashes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false, idempotentHint=true, destructiveHint=false, covering safety. The description adds behavioral detail about the return output: every match with position and capture groups, including named groups. This goes beyond annotations and provides useful context without contradicting them.

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?

Two sentences, each earning its place. The first states the core action and output; the second gives a concrete usage scenario. No redundant phrasing or padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's modest complexity, the description covers purpose, usage, and returns. An output schema exists to document the return structure, and annotations cover side-effect safety. The description is sufficient for an agent to select and invoke correctly.

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 provides descriptions for all three parameters (pattern, text, flags) with 100% coverage, including notes like 'without surrounding slashes' and default for flags. The description does not need to add much parameter-level detail, so a baseline of 3 is appropriate. It does hint at escaping concerns, but that's usage guidance, not parameter semantics.

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 starts with a specific verb ('Runs') and identifies the resource ('regular expression against sample text') and outcome ('returns every match with its position and capture groups'). The title 'Does this regex match — and what does it capture?' reinforces the purpose and distinguishes this from sibling tools like diff_text or extract_*.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

Explicitly states when to use: 'Use before wiring a pattern into code, instead of guessing whether the escaping survived the trip through JSON and the shell.' It provides clear context and a concrete use case, though it does not name an alternative tool explicitly. This is sufficient guidance for an AI agent.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.