Skip to main content
Glama

Regex tester

regex_test
Read-onlyIdempotent

Test a JavaScript regular expression against text to list every match, its groups, and position; optionally apply a replacement string.

Instructions

Run a JavaScript regular expression against text and list every match with its groups and position. (Same as IT-Tools /regex-tester.)

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
textYes
flagsNoJS flags, e.g. "gi"; "g" is always addedg
patternYes
replaceNoOptional replacement string ($1, $<name> supported)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and closed-world safety, so the bar is lower; the description adds the useful detail that all matches are returned with groups and positions. However it is silent on the replace parameter that exists in the schema, leaving the agent unsure whether the tool mutates text or only reports matches.

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 short sentences, front-loaded with the core behavior; the IT-Tools parenthetical is cheap but informative for parity. Nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 does the right thing by explaining the return shape (matches with groups and position). It is incomplete for a tool that also supports replacement, since that mode is entirely undescribed.

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

Parameters2/5

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

Schema coverage is 50%: flags and replace are documented in the schema, while pattern and text are self-evident by name. The description adds no parameter meaning at all and, worse, never mentions replace, whose behavior ($1, $<name>) is the most semantically significant part of the tool.

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 a specific action (run a JavaScript regex against text) and the result shape (every match with groups and position), so the agent knows exactly what the tool does. It does not name a sibling alternative, but the purpose itself is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no when-to-use guidance, no exclusions, and no mention of when the replace parameter should be used instead of plain matching. The agent must infer usage entirely from the purpose sentence.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.