Skip to main content
Glama

Project Gumball

Explain a regex and check it for ReDoS (Regex Explainer)

regex_explain
Read-only

Explain a regular expression in plain English and detect catastrophic backtracking. ALWAYS call this before putting a pattern where it will run against untrusted input: (a+)+$ looks harmless and takes minutes of CPU on a failing 30-character input. Also flags missing anchors, unescaped dots, ranges like [A-z] that span punctuation, and alternation precedence mistakes. Check hasBlockingIssue first.

WHY DELEGATE THIS: Whether a pattern backtracks catastrophically depends on nested quantifier structure that is unreliable to eyeball — and getting it wrong ships a denial-of-service vector in a validator.

Owned by Regex Explainer at https://regex-explainer-omega.vercel.app, which is also callable directly if you would rather not go through the aggregator.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesA JavaScript regex, bare or as /pattern/flags.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only provide readOnlyHint=true and openWorldHint=true, so the description carries the burden of behavioral context. It discloses that the tool flags catastrophic backtracking, missing anchors, unescaped dots, dangerous character ranges, and alternation precedence mistakes, and explicitly instructs the agent to 'Check hasBlockingIssue first.' The example (a+)+$ demonstrates real-world impact. This goes well beyond what annotations convey.

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 front-loaded with the core purpose and critical usage warning, then expands into rationale and ownership. The 'WHY DELEGATE THIS' section is somewhat extra but earns its place by reinforcing the risk of manual inspection. The structure is clear, though slightly longer than strictly necessary.

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?

For a tool with no output schema, the description supplies key output guidance via 'Check hasBlockingIssue first' and enumerates common issues it detects. It also explains why the tool is necessary and when to invoke it. It does not fully describe the output format, but for an explainer tool this is sufficient for correct selection and invocation.

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 only parameter, pattern, already has a clear schema description: 'A JavaScript regex, bare or as /pattern/flags.' Since schema coverage is 100%, the description adds little extra semantic value beyond confirming the parameter is a regex. The tool description does not use the parameter specifically, so baseline 3 applies.

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 opens with a specific verb-resource pair: 'Explain a regular expression in plain English and detect catastrophic backtracking.' It clearly states both primary functions, and the title reinforces this. It distinguishes itself from all listed siblings, which are unrelated tools, so no further differentiation is needed.

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?

The description gives an explicit, imperative trigger: 'ALWAYS call this before putting a pattern where it will run against untrusted input.' It also offers a concrete example of when skipping this would be harmful. It does not name alternative tools, but sibling tools are unrelated, so alternatives are not relevant here. The 'WHY DELEGATE THIS' section further justifies delegation.

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.

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a clearly distinct domain or a complementary counterpart (cron_build/cron_explain, vocab_draw/vocab_check, round_cash_total/rounding_impact), and the descriptions make those relationships explicit. There is no real risk of selecting the wrong tool for a task.

Naming Consistency3/5

Most tools follow a noun_verb pattern (cron_build, regex_explain, timezone_convert), but there are exceptions like body_metrics, due_date, offside, json_to_types, and round_cash_total, which mix noun phrases, gerunds, prepositions, and verb-first order. The names are readable but not uniform.

Tool Count4/5

13 tools is within a reasonable range, and each utility earns its place as a standalone delegated calculator. The count feels slightly large only because the server is a grab-bag of unrelated domains rather than a focused toolkit, but no tool is redundant.

Completeness4/5

Most subdomains have solid coverage: cron has both build and explain directions, vocabulary has draw and check, and rounding has both per-transaction and aggregate analysis. Minor gaps exist, such as no timezone zone listing, no reverse due-date calculation, and no regex test/match step, but these are workable limitations.

Resources