Skip to main content
Glama

Regex Generate

regex_generate
Read-only

A regular expression from a description, with examples that must match and examples that must not. The pattern is returned only when every example passes when tested in the service (one retry with the failures). Patterns with nested quantifiers are refused to avoid catastrophic backtracking. Examples are up to 10 strings of 300 characters each. Price: $0.002 in USDC per successful call, paid with x402 (Base, Solana or Arc); failed calls are not charged.

Input Schema

NameRequiredDescriptionDefault
matchesYesStrings the pattern must match (1-10 items, each max 300 characters)
nonMatchesNoStrings the pattern must not match (0-10 items, each max 300 characters)
descriptionYesWhat the pattern should match, in plain words (max 500 characters)

Output Schema

NameRequiredDescriptionDefault
noteNo
flagsNo
testsNo
patternNo
checkedAtNo
explanationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedOutput schema / properties / checkedAt
      Added value: +{}
    • addedOutput schema / properties / explanation
      Added value: +{}
    • addedOutput schema / properties / flags
      Added value: +{}
    • addedOutput schema / properties / note
      Added value: +{}
    • addedOutput schema / properties / pattern
      Added value: +{}
    • addedOutput schema / properties / tests
      Added value: +{}
  2. Added

TDQS

A4.3/5.0
Behavior5/5

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

It discloses key behavior beyond annotations: the pattern is returned only after every example passes, one retry is made with failures, nested quantifiers are refused to prevent catastrophic backtracking, examples are capped, and failed calls are not charged. Pricing and payment methods are also stated, with no contradiction of readOnlyHint.

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?

The description is a tight, front-loaded paragraph. Every sentence carries useful information: generation behavior, retry logic, safety refusal, limits, and pricing.

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 output schema exists, return-value details need not be repeated. The description covers all operationally important context: how the pattern is validated, retry/refusal behavior, example size limits, and payment conditions.

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 100%, so the schema already defines matches, nonMatches, and description with their types and limits. The description restates example limits but adds no dialect, format, or other parameter-level meaning beyond 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?

The description clearly states it generates a regular expression from a plain-language description, with explicit match/non-match examples. It is distinguishable from all siblings, none of which offer regex generation, and the constraints are front-loaded.

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?

The description implies the tool is used when you need a regex and can supply examples, but it does not explicitly state when to use it versus alternatives or when not to use it. No sibling alternative for regex generation exists, so the missing guidance is less costly.

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