Skip to main content
Glama

ai_regex

Read-only

AI regex generator — Turn a plain-English description into a regular expression with flags, explanation and matching examples; JavaScript patterns are compile-checked. Pass ?description= and optional ?flavor=. Price: $0.006 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": {
      "description": "<description>"
    },
    "name": "ai_regex"
  }
}

Input Schema

NameRequiredDescriptionDefault
flavorNooptional, default javascript
descriptionYeswhat the pattern should match

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true. The description adds real context beyond that: JavaScript patterns are compile-checked before return, and each call costs $0.006 USDC on Base via x402 — pricing and validation behavior an agent would otherwise not know.

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?

One front-loaded sentence covering purpose and output, followed by a short parameter and pricing note. No wasted text, though the '?description=' query-string notation is slightly awkward for an MCP tool whose schema defines the parameters separately.

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 usefully characterizes the return value (pattern, flags, explanation, examples) and discloses cost and compile-checking. The only missing piece is guidance on valid flavor values and what happens with non-JavaScript flavors.

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 both parameters are already documented in the schema, establishing the baseline of 3. The description adds only mild meaning — that the flavor affects compile-checking for JavaScript patterns — without explaining valid flavors or syntax of the input.

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 concrete verb and resource (turn a plain-English description into a regular expression) plus the payload returned (flags, explanation, matching examples). This clearly separates it from generic siblings like ai_ask or ai_chat.

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 says to pass ?description= and optional ?flavor=, which is invocation mechanics rather than when-to-use guidance. It gives no explicit conditions for choosing this over an alternative (e.g., ai_explain_code for reading an existing pattern), so usage is only implied.

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