Skip to main content
Glama

util_regex_test

Read-only

Regex Tester — Test a regular expression against text with the JavaScript (ECMAScript) engine. Returns validity (with the engine error if invalid), every match with index/end, numbered and named capture groups, group indices with the d flag, group count, full-match flag, and an optional replace preview ($1, $). Flags dgimsuyv (default g). Warns about patterns prone to catastrophic backtracking. Up to 200 matches, text max 10000 chars. Params: pattern, text; optional flags, replace. Pairs with /v1/ai/regex. Price: $0.001 USDC (Base, via x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pattern": "<pattern>",
      "text": "<text>"
    },
    "name": "util_regex_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes10-20 and 3-4
patternYes([0-9]+)-([0-9]+)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description goes well beyond them: engine identity, invalid-pattern error surfacing, catastrophic-backtracking warnings, the 200-match and 10000-char caps, and the optional replace preview. The one blemish is that it advertises optional 'flags' and 'replace' inputs that do not appear in the input schema, which could mislead an agent about what it can send.

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?

Dense but front-loaded: purpose first, then capabilities, then limits, then params and price. The 'Params:' and 'Price:' fragments are terse but scannable. It is long, yet nearly every clause carries operational information an agent would otherwise have to discover by trial.

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?

With no output schema, the description carries the return-value burden and does so thoroughly: validity, error text, match indices, numbered and named groups, d-flag group indices, full-match flag, and replace preview. Limits and failure modes are covered; only the parameter list mismatch with the schema leaves a completeness gap.

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

Parameters2/5

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

The description does explain pattern and text semantics and gives the flag alphabet with a default (dgimsuyv, default g) plus replace syntax ($1, $<name>), which is real added meaning. However, flags and replace are absent from the input schema, and the schema's own parameter descriptions are nonsensical ('10-20 and 3-4'), so the description simultaneously compensates for and contradicts the structured data.

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 against text) plus the engine (JavaScript/ECMAScript), and immediately enumerates what it returns. It is clearly distinguishable from the AI-oriented siblings such as ai_regex because it describes a deterministic engine-backed tester rather than generation.

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?

Gives clear usage context ('test a regular expression against text') and points to its complement with 'Pairs with /v1/ai/regex', implying this is the verification step after regex generation. It stops short of an explicit when-not or a direct comparison to ai_regex's behavior, so the routing is inferred rather than stated.

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.

Resources