Skip to main content
Glama

Lordevo Shop: website checks for agents (x402)

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

regex_test
Read-onlyIdempotent

$0.0021 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.1/5.0
Behavior5/5

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

Annotations already establish readOnly/idempotent/non-destructive, and the description goes well beyond them: a 3-second execution cap on catastrophic backtracking with no charge, per-call cost, free-trial quota (3 per IP per UTC day), input-size ceilings, and the offline/no-network nature. These are exactly the operational traits an agent needs to decide whether to call and how to interpret a timeout.

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?

Two dense sentences plus a limits line; front-loaded with cost and then the core operation, with no filler. Minor redundancy exists ('POST for long text' appears in both description and schema text, and the price is repeated from the title), but nothing is confusing or bloated.

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?

With an output schema present, return values need not be explained, yet the description still sketches them usefully. Limits, cost, timeout behavior, and input encodings are all covered; only minor gaps remain, such as what happens on an invalid pattern (error vs. empty result).

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 baseline is 3. The description restates the parameter set ('pattern (or /pattern/flags), text, optional flags, mode, replace, max_matches') and flags the POST-for-long-text option, but adds no syntax or format meaning beyond what the schema already documents for each field.

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 names a specific verb and resource: 'Runs a JavaScript (ECMAScript) regular expression on your text', and enumerates the return shapes (matches with index, line, column, numbered and named groups; replace/split results). An agent can immediately tell this apart from siblings like json_query or math_eval 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is present but implicit: mode semantics ('match', 'test', 'replace', 'split') and the trial/payment switch are stated, and try_free is named as a free alternative. However, there is no explicit guidance on when to prefer this tool over a sibling or when not to use it, so an agent must infer applicability from the tool's purpose.

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