Skip to main content
Glama

ToolForte

Regex Tester

test_regex
Read-onlyIdempotent

Use this when you need to know what a regular expression actually matches. Example prompt: "Does this regex match every email address in this text?" Run a JavaScript regular expression against a test string using a real regex engine. Returns all matches with capture groups and indices. Costs 1 credit. The answer is deterministic.

Input Schema

NameRequiredDescriptionDefault
textYesThe text to run the expression against
flagsNoRegex flags such as g, i, m, s, u (default g)g
patternYesJavaScript regular expression source, without the slashes

Output Schema

NameRequiredDescriptionDefault
countNoNumber of items
resultNoThe result, when it is not an object
matchesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
  2. Changed4 schema fields changed
    • addedInput schema / properties / flags / description
      Added value: +"Regex flags such as g, i, m, s, u (default g)"
    • addedInput schema / properties / pattern / description
      Added value: +"JavaScript regular expression source, without the slashes"
    • addedInput schema / properties / text / description
      Added value: +"The text to run the expression against"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "count": {
      +      "description": "Number of items",
      +      "type": "number"
      +    },
      +    "matches": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "result": {
      +      "description": "The result, when it is not an object"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed4 schema fields changed
    • removedInput schema / properties / flags / description
      Removed value: -"Regex flags such as g, i, m, s, u (default g)"
    • removedInput schema / properties / pattern / description
      Removed value: -"JavaScript regular expression source, without the slashes"
    • removedInput schema / properties / text / description
      Removed value: -"The text to run the expression against"
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "https://json-schema.org/draft/2020-12/schema",
      -  "additionalProperties": {},
      -  "properties": {
      -    "count": {
      -      "description": "Number of items",
      -      "type": "number"
      -    },
      -    "matches": {
      -      "items": {},
      -      "type": "array"
      -    },
      -    "result": {
      -      "description": "The result, when it is not an object"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  4. Changed4 schema fields changed
    • addedInput schema / properties / flags / description
      Added value: +"Regex flags such as g, i, m, s, u (default g)"
    • addedInput schema / properties / pattern / description
      Added value: +"JavaScript regular expression source, without the slashes"
    • addedInput schema / properties / text / description
      Added value: +"The text to run the expression against"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "count": {
      +      "description": "Number of items",
      +      "type": "number"
      +    },
      +    "matches": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "result": {
      +      "description": "The result, when it is not an object"
      +    }
      +  },
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world. The description adds genuinely new behavior: it uses a real JS engine rather than simulation, the answer is deterministic, it costs 1 credit, and it returns all matches with capture groups and indices. The remaining gap is error behavior for invalid patterns, which is only implied.

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 usage trigger, followed by an example and then the behavioral facts. Every sentence carries information, though the example prompt is slightly redundant with the opening sentence.

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?

An output schema exists, so return values need no elaboration, and the description still names the return shape. With annotations covering safety, an agent has cost, determinism, engine fidelity, and invocation condition — nothing material is missing.

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 pattern, text, and flags are fully documented in the schema, including flag defaults and the 'no slashes' convention. The description adds nothing parameter-specific beyond naming the test string and regex, so 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: run a JavaScript regular expression against a test string, and return matches with capture groups and indices. This is clearly distinguishable from sibling tools like text_diff or format_json, which operate on text without 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?

Opens with an explicit trigger condition ('Use this when you need to know what a regular expression actually matches') and adds an example prompt that maps a natural question to the tool. No exclusions or named alternatives are given, but no sibling tool really overlaps, so the guidance is sufficient.

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