Skip to main content
Glama

test_regex

Validate a regex pattern against labeled text cases and get pass/fail plus capture groups for each case.

Instructions

Test a regex against labelled cases [{text, should_match}]; returns per-case pass/fail and capture groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
casesYes
flagsNo
patternYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, and it leaves key behaviors unstated: what happens with an invalid or uncompilable pattern (error vs. per-case failure), whether all cases run or it short-circuits, and how flags affect matching. Noting 'per-case pass/fail and capture groups' is largely a restatement of what the output schema already exposes.

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?

A single dense sentence that leads with the action and input shape, then the return. No filler, nothing redundant, nothing misplaced.

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?

An output schema exists, so return values need not be spelled out, and the description supplements the schema with the case-object shape. It stops short of covering flags semantics and invalid-pattern behavior, which is the main remaining gap for a tool of this modest complexity.

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 add real value by disclosing the item keys of the otherwise opaque 'cases' array ({text, should_match}), but it says nothing about the 'flags' parameter (default '') or expected pattern syntax.

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?

States a specific verb and resource — 'Test a regex against labelled cases' — and names the input shape and output, so the operation is unambiguous. It does not differentiate itself from the sibling verifier tools (verify_math, validate_schema, check_units), though the domain difference makes confusion unlikely.

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 only implied: the mention of 'labelled cases [{text, should_match}]' signals this is a labelled-test harness, so an agent can infer it is for checking a candidate pattern against known expectations. There is no explicit when-to-use/when-not guidance or comparison against alternatives such as run_code for ad-hoc regex execution.

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