Skip to main content
Glama

ScorpTech x402 Tools

Regex Explain

regex_explain
Read-onlyIdempotent

Explain, lint and test a regular expression before an agent ships it. Parses the pattern (PCRE, JavaScript, Python, Go/RE2, Java or .NET syntax) into a token-by-token plain-English explanation with capture groups; flags ReDoS risks (nested quantifiers, overlapping alternation in repeats, adjacent overlapping quantifiers) and confirms them with a crafted input against a backtracking limit; warns about common bugs (unescaped dots in domains, [A-z], empty alternatives, unanchored validators); reports which features each regex flavour does not support (lookbehind, possessive / atomic, \A \z, named-group syntax, Unicode classes, backreferences in RE2); and runs the pattern on sample strings returning every match with its groups and offsets. Returns JSON with: pattern, flags, flavor, valid, explanation, summary, groups, warnings. Price: $0.002 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/regex-explain

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>"
    },
    "name": "regex_explain"
  }
}

Input Schema

NameRequiredDescriptionDefault
flagsNoi, m, s, x, u (g and y are accepted and ignored)
testsNoSample strings to run the pattern on
flavorNopcre
patternYesThe regex (a JavaScript literal like /abc/gi is also accepted)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description goes well beyond them: it discloses the mechanism for ReDoS confirmation (crafted input against a backtracking limit), the cost model ($0.002 USDC per successful call via x402 on Base or Solana), an alternate HTTPS endpoint, and the exact JSON return fields. This is unusually rich behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded correctly, but the body is a single dense run-on sentence packing seven distinct capabilities plus pricing and endpoint details. It is information-rich with little filler, yet the lack of sentence breaks hurts scannability and buries the return-value list at the end.

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?

For a four-parameter read-only analysis tool with no output schema, the description supplies the return field list (pattern, flags, flavor, valid, explanation, summary, groups, warnings), the analysis categories, and even pricing and transport details. Nothing an agent needs to call it correctly is missing.

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

Parameters4/5

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

Schema coverage is 75%, and the description supplements it by enumerating supported flavors (PCRE, JavaScript, Python, Go/RE2, Java, .NET) and clarifying that the pattern is parsed per-flavor, plus it implies the tests parameter via 'runs the pattern on sample strings returning every match with its groups and offsets'. The flags parameter is not elaborated in prose, but the schema covers it.

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 opens with a specific verb-and-resource statement ('Explain, lint and test a regular expression') and enumerates the concrete capabilities: token-by-token explanation, ReDoS detection, bug warnings, flavor feature gaps, and sample-string matching. An agent knows exactly what this tool produces without opening the schema.

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?

It gives a clear usage context ('before an agent ships it'), which frames the tool as a pre-deployment validation step. It does not name alternatives or exclusions, notably not distinguishing itself from the sibling regex_test, which appears to overlap with the sample-matching portion of this tool.

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