Skip to main content
Glama
XlogicX

regex-quality

by XlogicX

suggest_rewrites

Generate verified safe regex rewrites for ReDoS-prone patterns. Each candidate is tested for correctness, non-linear performance, and equivalence before returning the best.

Instructions

Mechanically generate safe-rewrite CANDIDATES for a ReDoS-prone pattern and return only the ones that are VERIFIED. Use this when analyze/redos_bench flags a pattern as super-linear and you want a concrete, drop-in replacement rather than just the name of a technique.

Each candidate is independently checked: correctness on your positives/ negatives, non-super-linear growth on engine, AND language equivalence to the original (exact DFA comparison when both are regular, else seeded differential fuzzing). A candidate is marked safe/chosen as best ONLY if all three hold -- never an unverified guess. best is null when nothing verifies. Deterministic for a given seed. Note: atomic-group/possessive candidates need a modern engine (Python re>=3.11, PCRE2, Java); RE2/Go can't parse them, which the candidate notes call out.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNo
engineNopython
fuzz_nNo
patternYes
negativesNo
positivesNo
timeout_msNo
equivalence_modeNoauto

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations are provided, so the description fully bears the transparency burden. It details the three independent verification checks (correctness on positives/negatives, non-super-linear growth, language equivalence), explains that `safe`/`best` are only assigned when all checks pass, states `best` is null if nothing verifies, mentions determinism for a given seed, and calls out engine compatibility limitations. This is comprehensive behavioral disclosure.

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 dense but well-organized: core purpose, usage context, verification process, and caveats are presented in a logical progression. Every sentence adds information, though it is somewhat lengthy. It earns a high score for structure without being excessively verbose.

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 complexity (8 parameters, no annotations) and that an output schema exists (which covers return structure), the description is complete. It covers when to use, how verification works, failure behavior (`best` null), determinism, and engine limitations. This is sufficient for an agent to select and invoke the tool 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?

Schema description coverage is 0%. The description adds meaning for key parameters (`seed`, `engine`, `positives`/`negatives`) by explaining their roles in determinism, engine-specific parsing, and correctness checks. However, `fuzz_n`, `timeout_ms`, and `equivalence_mode` are not mentioned, leaving gaps in the parameter semantics. It partially compensates but not fully for all 8 parameters.

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 'Mechanically generate safe-rewrite CANDIDATES for a ReDoS-prone pattern and return only the ones that are VERIFIED,' which uses a specific verb and resource. It clearly distinguishes from siblings by referencing `analyze`/`redos_bench` flags and offering concrete replacements rather than technique names.

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?

Explicitly states when to use: 'Use this when `analyze`/`redos_bench` flags a pattern as super-linear and you want a concrete, drop-in replacement rather than just the name of a technique.' It also provides alternative-aware guidance by contrasting with 'name of a technique' and highlights engine caveats for atomic-group candidates.

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/XlogicX/ReDetox'

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