MCP server that parses a regex into a real AST to explain it in plain English and to flag catastrophic-backtracking (ReDoS) risk -- before an agent ships a regex it never actually tested.
Two well-named, focused tools with clear descriptions and complete input schemas. Tool names follow verb_noun pattern (explain_regex, check_redos_risk). Descriptions are detailed (150-250 chars) and explain WHAT, WHEN, and WHY. Input schemas include type, description, and constraints (minLength, maxLength). However, output schemas are not documented, LLMs cannot predict return structure. No error handling guidance or recovery paths. No parameter validation examples. Risk annotations present but minimal.
Statically analyze a regex's structure for the two classic causes of catastrophic backtracking: nested quantifiers (e.g. "(a+)+") and ambiguous alternation inside a repeated group (e.g. "(a|a)+"). Both can make a backtracking regex engine take exponential time on a crafted or even accidental non-matching input -- a real, exploitable denial-of-service vector, and a common defect in regexes generated without testing against adversarial input. This tool NEVER executes the pattern -- it only parses and inspects the pattern's source structure, so it's safe to run on untrusted or deliberately malicious patterns without risk of hanging.
Parse a regular expression into a real syntax tree and describe in plain English what it matches. Use this to sanity-check a regex you (or someone else) wrote actually does what you intended, before shipping it.
Output schemas not documented. LLMs cannot predict return structure (fields, types, nesting). Forces trial-and-error parsing of responses.
No error handling guidance. If regex parsing fails (invalid syntax), tool returns error but does not guide LLM on recovery (e.g., 'Try simplifying the pattern' or 'Check for unescaped special chars').
Parameter descriptions lack format/constraint details. 'The regex source, without delimiters' does not explain what 'without delimiters' means (no /.../ wrapper?) or show an example. LLMs may pass /^[a-z]+$/ instead of ^[a-z]+$.
No idempotency guarantee documented. Both tools are read-only (safe to retry), but this is not explicitly stated in descriptions. Agents need to know which calls are safe to retry.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 62 | 2025-06-18+ | v2 |
Tool annotations present (Risk: READ_ONLY) but not leveraged in descriptions. Descriptions should explicitly state 'This tool never executes the pattern, it only parses and inspects structure, so it is safe to run on untrusted input.'