Skip to main content
Glama

regex_regex_extract_groups

Extract captured groups from regex matches in text. Input pattern and text, return each match with its numbered and named groups.

Instructions

[regex] Extract captured groups from all matches. Returns list of {match, groups, named_groups} for each match. Use when the pattern defines named or numbered groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYes
textYes
flagsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description fully discloses the return structure and that it processes all matches, which is sufficient for a read-only regex operation. It could mention that it doesn't modify state, but the behavior is clear.

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?

Two sentences that are direct and no fluff. Every word adds value, making it easy to scan.

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?

Given the output schema exists, the return description is adequate, but the lack of parameter documentation and minimal differentiation from numerous sibling regex tools leaves gaps. The description could include typical use cases or contrast with other regex tools.

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 0%, yet the description provides no explanation of the parameters (pattern, text, flags). It only adds context about the return format, not the inputs, so it fails to compensate for the missing schema docs.

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 extracts captured groups from all matches, specifying it returns a list of {match, groups, named_groups} for each match. It distinguishes from siblings like findall or match by focusing on patterns with groups.

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?

Explicitly advises using when the pattern defines named or numbered groups, giving clear context. Could mention alternatives like findall for patterns without groups, but still provides good guidance.

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/0-co/agent-friend'

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