Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

regex_test

Read-onlyIdempotent

Test a regular expression pattern against an input string and return all matches with their index positions and named capture groups. Use for validating user inputs, extracting structured data from text, or debugging regex patterns. Supports flags g, i, m, s, u, y. The match runs in an isolated thread with a 500 ms budget: a pattern that blows up (catastrophic backtracking, e.g. "(a+)+$") comes back as redos_detected:true — a real ReDoS verdict on your pattern — instead of hanging.

Input Schema

NameRequiredDescriptionDefault
flagsNoRegex flags: g (global), i (case-insensitive), m (multiline), s (dotAll) — default: ""
inputYesThe string to test against (max 50 KB)
patternYesRegular expression pattern (without delimiters)

Output Schema

NameRequiredDescriptionDefault
noteNo
flagsNo
matchedNo
matchesNo
patternNo
verdictNo
elapsed_msNo
match_countNo
redos_detectedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "flags": "g",
      +    "input": "a 12-34 b 5-6",
      +    "pattern": "\\d+-\\d+"
      +  }
      +]
  2. Changed3 schema fields changed
    • addedOutput schema / properties / elapsed_ms
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / redos_detected
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / verdict
      Added value: +{}
  3. Changed1 schema field changed
    • changedInput schema / properties / flags / description
      Previous value: -"Regex flags: g (global), i (case-insensitive), m (multiline), s (dotAll) — default: \"\""New value: +"Regex flags: g (global), i (case-insensitive), m (multiline), s (dotAll) — default: \"\""
  4. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "flags": {},
      +  "match_count": {
      +    "type": "number"
      +  },
      +  "matched": {},
      +  "matches": {},
      +  "note": {},
      +  "pattern": {}
      +}
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  6. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations by disclosing the 500 ms isolated-thread budget and the exact failure mode: catastrophic backtracking returns redos_detected:true instead of hanging. That is precisely the kind of operational trait an agent cannot infer from structured fields.

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?

Three tight sentences: capability first, use cases second, then the critical runtime caveat. No filler, and the ReDoS warning is placed where it will be read before invocation.

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?

An output schema exists, so return values need not be spelled out, yet the description still flags the redos_detected field that matters most. Combined with full parameter coverage and clear annotations, nothing an agent needs is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning by enumerating supported flags including u and y, which the schema's flags description omits (it lists only g, i, m, s). That genuinely extends the schema.

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?

States a specific verb and resource ('Test a regular expression pattern against an input string') and immediately specifies the return shape (matches, index positions, named capture groups). This clearly separates it from siblings like extract_json_path or text_stats.

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?

Names three concrete use cases (validating user inputs, extracting structured data, debugging regex), giving a clear sense of when to reach for it. It does not, however, name any alternative tool or exclusion condition, so a 4 rather than a 5.

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.