Skip to main content
Glama

regex_extract

Applies a JavaScript regular expression to text and returns matches with groups and positions, or a replacement result. 0.001 USDC per call via x402.

Input Schema

NameRequiredDescriptionDefault
textYesInput text
flagsNoFlags, default g
patternYesRegex pattern
replaceNoOptional replacement string
paymentProofNoPayment proof: USDC tx hash on Polygon or Base (0x...) or Solana tx signature. Omit on the first call to receive the 402 payment instructions, pay, then call again with the proof.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two useful traits: the priced model (0.001 USDC per call via x402) and the return form. It omits failure behavior, defaulting behavior for flags, and any safety constraints on arbitrary regex execution, leaving meaningful gaps for a paid mutation-capable tool.

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?

One front-loaded sentence covering the operation and return shape, plus a short pricing clause. No filler and nothing important buried.

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 compensates by naming the return contents (matches, groups, positions, or replacement result) and the cost/payment model. Only error and edge-case behavior remain unspecified.

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 all five parameters including the x402 paymentProof flow are already documented. The description only adds the notion of a 'replacement result' for the replace parameter, which is marginal added value — baseline 3 is appropriate.

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 (applies), resource (JavaScript regular expression to text), and the result shape (matches with groups and positions, or a replacement result). No sibling overlaps this capability, so an agent can identify it unambiguously against tools like text_stats or text_diff.

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 by the description of what it does; there is no explicit when-to-use guidance versus alternatives (e.g., link_extract or redact_pii for specific patterns) and no stated exclusions or limits such as ReDoS risk. The payment model is mentioned but that is a precondition, not usage guidance.

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.