Skip to main content
Glama

Regular Expression Test

regex_test
Read-onlyIdempotent

Run a regular expression against sample strings, with a time cap. Send pattern, samples (up to 50 strings) and optionally mode (search, fullmatch or all), and the flags ignore_case, multiline, dotall, ascii. Get back, for each sample, whether it matched and every match with its start and end (counted in characters), the matched text and each capture group (number, name, span, text), or a clear error if the pattern is not valid. The flavor is Python (the 'regex' module in VERSION0 mode, a superset of Python re); the answer says if plain Python re would also accept the pattern. A pattern that backtracks for more than 0.5 s on a sample is reported as timed_out, not run forever. Answer fields: ok, verdict, result, rule, does_not, sources, observation, signature, verify. Errors: ok false with the reason (bad input, too large, hourly limit). Free. No model, no network, nothing you send is stored by the tool, and every answer is signed with LLPRO's key (check it at https://llpro.ai/regex-test). Not legal, tax or financial advice.

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

Input Schema

NameRequiredDescriptionDefault
modeNosearch (default): the first match anywhere in the sample; fullmatch: the whole sample must match; all: every non-overlapping match (up to 100 per sample).
asciiNo\w \d \s \b match ASCII only (flag a). Default false: they match Unicode letters and digits.
dotallNo. also matches a line break (flag s). Default false.
patternYesThe regular expression (Python / regex-module syntax), 1 to 500 characters. Do not put emails, Social Security, phone or card numbers in it.
samplesYesStrings to test, 1 to 50, each up to 2000 characters (an empty string is allowed). Made-up test data only: emails, web addresses with a scheme, Social Security and phone shapes and card numbers are refused.
multilineNo^ and $ also match at line breaks inside the sample (flag m). Default false.
ignore_caseNoCase-insensitive matching (flag i). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so the safety bar is low. The description still adds real value beyond them: a 0.5 s per-sample backtracking cap reported as timed_out, hourly-limit and too-large errors, no storage of input, and signed answers verifiable at a URL. It stops short of describing exact response payload semantics, listing output field names (ok, verdict, result, rule, sources, signature…) without explaining them.

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?

Purpose and time cap are front-loaded correctly, but the text is a dense run-on that packs flags, error taxonomy, output field names, signing, pricing and a legal disclaimer into one block. Tangential material like 'Not legal, tax or financial advice' and the unexplained field-name list dilute an otherwise well-scoped definition.

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 no output schema, the description carries the burden of describing returns, and it does: match/no-match per sample, character-counted spans, capture groups with number/name/span/text, timed_out, and error reasons. Only the terse 'Answer fields' enumeration is left opaque, a minor gap for a tool this simple.

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%, and the description mostly restates what the schema already says (mode values, the four flags, 1-50 samples of up to 2000 chars). It adds a little, such as spans counted in characters and capture-group detail, but that is return-value information rather than parameter meaning, so the baseline 3 applies.

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 up front: 'Run a regular expression against sample strings, with a time cap.' It also pins the flavor (Python regex module, VERSION0, superset of re) so an agent knows exactly what dialect it is invoking, with no sibling in the catalog that could be confused with it.

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: sample limits, that made-up test data only is accepted, and that PII-shaped strings are refused. It defines each mode (search/fullmatch/all) so the agent can pick the right one, but offers no explicit when-not-to-use guidance or named alternative, since none exists among the siblings.

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