Skip to main content
Glama

正则表达式生成(按次计费)

regexgen

自然语言 → 精确正则 + 逐段解释 + 匹配示例,防灾难性回溯。按次计费:业务成功才确认扣款,内容违规、模型超时或生成失败会自动全额退款。

Input Schema

NameRequiredDescriptionDefault
flavorNo正则方言。javascript
sampleNo可选:待匹配的示例文本,给得越准结果越准。
requestIdNo幂等键。同一次业务重试时复用同一个值,可避免重复扣费。
requirementYes匹配需求,用自然语言描述,如「匹配中国大陆手机号」。

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and discloses important traits: per-call billing, charge confirmation only on business success, automatic full refund on content violations, model timeouts, or generation failures, and a safety property about catastrophic backtracking. It does not cover rate limits or authentication, but the billing and failure behavior are unusually well specified.

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 two tight clauses with no waste: the core capability comes first, followed by the billing/refund policy. It is appropriately front-loaded and sized for the tool.

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?

There is no output schema, but the description names the main return components: the regex, segment-by-segment explanation, and matching examples. Combined with the fully documented parameters and billing policy, this is nearly complete, though it does not detail exact response shape or limitations.

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 documents all four parameters. The description only implicitly references the natural-language requirement and sample text, adding no additional parameter semantics beyond what the schema provides.

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?

The description states a specific transformation: natural language to precise regex, plus segment explanations and match examples, with protection against catastrophic backtracking. This is clearly a regex-generation tool, though it does not explicitly differentiate itself from siblings such as codegen or script.

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 implied by the natural-language-to-regex framing, but the description gives no explicit when-to-use, when-not-to-use, or alternative-tool guidance. An agent must infer that it should choose this over codegen or script when the task is specifically regex generation.

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.