Skip to main content
Glama
regexlab-mcp
by 0xmortuex

suggest_tests

Generate verified should-match and should-not-match test strings for a regex by running examples in the real engine, exposing surprising matches that reveal unanchored or overly broad patterns.

Instructions

Generate should-match and should-not-match test strings for a regex, verified by running.

Builds examples from the pattern's structure (each alternative, quantifier minimum and maximum, class boundaries) plus mutations (deleted or replaced characters, junk prefix/suffix, trailing newline, case swap, off-by-one repeat counts), then RUNS all of them in the real engine. Only confirmed examples are listed as tests. Mutations that unexpectedly still match are listed as SURPRISES - they often expose a missing anchor, a $ that accepts a trailing newline, or a class that is too broad. Uses search semantics (match anywhere), and says when the pattern is not anchored.

engine: "python" (default), "javascript" or "regex" (must be available).

Input Schema

NameRequiredDescriptionDefault
flagsNo
engineNopython
patternYes
timeout_sNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the generation strategy, that examples are RUN and only confirmed ones are listed, that unmatched mutations appear as SURPRISES, and that matching uses search (unanchored) semantics. The main omission is the timeout_s behavior — nothing says what happens when the engine exceeds the budget.

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 core purpose is front-loaded in the first sentence, with the mechanism, verification step, and SURPRISE interpretation following in a logical order. A few clauses restate the same idea (running/verified) but nothing egregious is included.

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 4-parameter tool with an output schema, the description covers generation logic, verification, result categories, and matching semantics thoroughly. The remaining gap is operational: no mention of timeout behavior or what happens on engine unavailability beyond a bare 'must be available'.

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%, so the description must compensate. It does so for `engine` by listing the accepted values and the important caveat that 'javascript'/'regex' must be available, which the schema does not convey via an enum. However, `flags` and `timeout_s` get no explanation at all, leaving half the parameters undocumented in both places.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and artifact — 'Generate should-match and should-not-match test strings for a regex, verified by running' — which is clearly distinct from siblings like test_regex or explain_regex. It does not explicitly name or route against those siblings, so it stops short of a 5.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the description explains that SURPRISES 'often expose a missing anchor, a `$` that accepts a trailing newline, or a class that is too broad,' which tells the agent why it would want this tool. There is no explicit 'use this instead of test_regex when...' statement or precondition about when generating tests is appropriate.

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