Skip to main content
Glama

test_regex

Test a regular expression against text and return all matches to debug patterns, extract groups, or verify expressions.

Instructions

Test a regular expression against text and return all matches.

Use this to debug regex patterns, extract matching groups,
or verify patterns before using in your code.

Parameters:
    regex — Regular expression pattern (e.g. '\d+').
    text  — Text to test the regex against.
    flags — Regex flags (default: 'g').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regexYes
textYes
flagsNog

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations exist, so the description carries the burden. It states it 'return all matches' but does not discuss behavior like what happens with invalid patterns or performance. Adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, with two short paragraphs. The first clearly states purpose and return, the second lists parameters. No unnecessary words.

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?

Given the tool has an output schema (implied by 'has output schema: true'), the description appropriately focuses on input and purpose. It covers matching groups and verification. Could mention regex flavor, but not essential.

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

Parameters4/5

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

Schema coverage is 0%, but the description separately explains each parameter: regex (pattern with example), text (text to test), flags (default 'g'). Adds meaningful context beyond the schema.

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 clearly states the tool tests a regular expression against text and returns all matches, using a specific verb ('Test') and resource ('regular expression'). It distinguishes from sibling tool 'regex_escape' which escapes regex patterns.

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?

The description provides explicit use cases: 'debug regex patterns, extract matching groups, or verify patterns before using in your code.' It does not mention when not to use it or alternatives, but the context is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scotia1973-bot/api-hub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server