Skip to main content
Glama

Lordevo Shop (x402 website checks)

Regex tester: matches, groups, replace and split (JavaScript flavor) ($0.002/call)

regex_test
Read-onlyIdempotent

$0.002 per call (x402, USDC on Base; free trial: add "trial": true or use try_free). [Data utilities] Runs a JavaScript (ECMAScript) regular expression on your text and returns every match with index, line, column, numbered and named groups, or the result of replace or split. Catastrophic patterns are stopped after 3 seconds and not charged. Input: pattern (or /pattern/flags), text, optional flags, mode, replace, max_matches (POST for long text). Limits: 2,000-character pattern, 400,000-character text. Offline.

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

Input Schema

NameRequiredDescriptionDefault
modeNomatch (all matches with groups, default), test (first match only), replace or splitmatch
textYesText to run the regex on, up to 400,000 characters (POST for long text)
flagsNoRegex flags, e.g. gi (or write the pattern as /.../flags)
trialNoOptional. true = free if a trial call is left (3 per IP per UTC day), else the payment terms.
patternYesJavaScript regular expression, up to 2,000 characters, either the bare pattern or /pattern/flags
replaceNoReplacement for mode=replace ($1, $<name>, $&; default empty = delete matches)
max_matchesNoMatches to list, 1-1000 (default 100)100

Output Schema

NameRequiredDescriptionDefault
modeNo
toolNo
cacheNo
flagsNo
notesNo
partsNo
_trialNoPresent when the call was a free trial call.
flavorNo
resultNo
matchedNo
matchesNo
patternNo
providerNo
price_usdNo
truncatedNo
group_countNo
group_namesNo
match_countNo
replaced_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / trial / description
      Previous value: -"Optional. true = answer free if a trial call is left (3 per IP per UTC day); otherwise you get the payment terms."New value: +"Optional. true = free if a trial call is left (3 per IP per UTC day), else the payment terms."
  2. Changed2 schema fields changed
    • addedInput schema / properties / trial
      Added value: +{
      +  "description": "Optional. true = answer free if a trial call is left (3 per IP per UTC day); otherwise you get the payment terms.",
      +  "type": "boolean"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "required": [
      +        "tool",
      +        "pattern",
      +        "mode"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "accepts": {
      +          "type": "array"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "resource": {
      +          "type": "object"
      +        },
      +        "x402Version": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "x402Version",
      +        "accepts"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "charged": {
      +          "type": "boolean"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "error"
      +      ]
      +    }
      +  ],
      +  "properties": {
      +    "_trial": {
      +      "description": "Present when the call was a free trial call.",
      +      "type": "object"
      +    },
      +    "cache": {
      +      "type": "object"
      +    },
      +    "flags": {
      +      "type": "string"
      +    },
      +    "flavor": {
      +      "type": "string"
      +    },
      +    "group_count": {
      +      "type": "integer"
      +    },
      +    "group_names": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "match_count": {
      +      "type": "integer"
      +    },
      +    "matched": {
      +      "type": "boolean"
      +    },
      +    "matches": {
      +      "items": {
      +        "properties": {
      +          "column": {
      +            "type": "integer"
      +          },
      +          "end": {
      +            "type": "integer"
      +          },
      +          "groups": {
      +            "items": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "type": "array"
      +          },
      +          "index": {
      +            "type": "integer"
      +          },
      +          "line": {
      +            "type": "integer"
      +          },
      +          "match": {
      +            "type": "string"
      +          },
      +          "named": {
      +            "type": [
      +              "object",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "mode": {
      +      "enum": [
      +        "match",
      +        "test",
      +        "replace",
      +        "split"
      +      ],
      +      "type": "string"
      +    },
      +    "notes": {
      +      "type": "array"
      +    },
      +    "parts": {
      +      "items": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "type": "array"
      +    },
      +    "pattern": {
      +      "type": "string"
      +    },
      +    "price_usd": {
      +      "type": "number"
      +    },
      +    "provider": {
      +      "type": "string"
      +    },
      +    "replaced_count": {
      +      "type": "integer"
      +    },
      +    "result": {
      +      "type": "string"
      +    },
      +    "tool": {
      +      "type": "string"
      +    },
      +    "truncated": {
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, and the description adds genuinely non-obvious behavior: catastrophic patterns are aborted after 3 seconds and are not charged, plus hard pattern and text length limits. Cost model ($0.002/call, x402 USDC on Base) and the trial quota are also disclosed, none of which appear in the annotations.

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?

Everything is packed into three front-loaded sentences with no filler, and the limits/mode information is easy to scan. Minor waste: the 2,000-character pattern and 400,000-character text limits are repeated verbatim from the schema, and the pricing/trial sentence leads before the tool's purpose is stated.

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 7-parameter tool with full schema coverage, rich annotations, and an output schema, the description covers everything an agent needs to call it correctly: mode semantics, limits, timeout behavior, and payment terms. Return values are delegated to the output schema, which is appropriate.

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 coverage is 100% and each property already carries a description, so the description only needs to frame the parameters, which it does by listing pattern/text/flags/mode/replace/max_matches. It adds the useful note that pattern may be written as `/pattern/flags`, but that is also in the schema, so no real meaning is added beyond structure.

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 and resource ("Runs a JavaScript (ECMAScript) regular expression on your text") and enumerates the exact return shape: every match with index, line, column, numbered and named groups, or replace/split output. The regex-tester role is unambiguous and distinct from every sibling in the list (no other tool touches pattern matching).

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?

Gives clear operating context: use `trial: true` or the `try_free` sibling to avoid charges, and POST for long text. It does not state explicit exclusions (e.g. when to prefer a simpler literal search or a different tool for glob matching), but the domain is narrow enough that alternatives are barely relevant.

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