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. Price: $0.002 USDC per successful call (x402, 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.1/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent/non-destructive annotations: discloses the paid x402/Solana pricing model ($0.002 USDC per successful call, implying failed calls are free), gives the equivalent HTTPS endpoint, explains that ReDoS findings are confirmed with a crafted input against a backtracking limit, and describes what each output section contains. That is exactly the context annotations cannot carry.

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?

Front-loaded with the core purpose, and virtually every clause carries information (inputs, six analysis passes, pricing, endpoint). It is a single dense wall of text that would scan faster as a short list, but there is little genuine padding.

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?

With no output schema, the description still accounts for every return surface — explanation, capture groups, ReDoS risk classes, bug warnings, per-flavour unsupported features, and matches with groups and offsets. Combined with the pricing and alternate-endpoint note, an agent has everything needed to decide and call correctly.

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%, so the schema already documents flags and tests. The description adds real meaning by listing the supported flavours (PCRE, JavaScript, Python, Go/RE2, Java, .NET), matching the enum, and explaining that flavour selection drives the unsupported-feature report; it also echoes the JS-literal pattern form. Flags semantics are left entirely to the schema.

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?

States precise verbs and resource: explain, lint and test a regular expression, and enumerates the concrete outputs (token-by-token explanation with capture groups, ReDoS flags, bug warnings, flavour support gaps, match runs with groups and offsets). It is unmistakably a regex-analysis tool, though it never names its closest sibling regex_test, which overlaps on the 'run the pattern on sample strings' behavior.

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 phrase 'before an agent ships it' implies a pre-deployment validation context, which is useful implicit guidance. However, there is no explicit statement of when to prefer this over regex_test, or when only linting (vs. running tests) is needed, and no exclusions are given.

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