Skip to main content
Glama
kinbinghua-lgtm

agent-core-mcp

regex_extract

Read-onlyIdempotent

Apply a regular expression to text and return every match with index, numbered and named capture groups, plus a ReDoS risk assessment. Execution is budget-capped to prevent hangs.

Instructions

Apply a regular expression and return every match with its index, numbered capture groups and named groups. Iteration and match counts are hard-capped so a pathological pattern cannot hang the host. The response includes a ReDoS risk assessment of the pattern.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to search
flagsNoFlags from g i m s u y (g is always applied)
patternYesRegular expression source, without slashes
budgetMsNoExecution deadline in milliseconds (default 1000, max 10000). Execution runs in a worker thread that is terminated on expiry.
maxMatchesNoCap on returned matches (default 500)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.5/5.0
Behavior4/5

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

With readOnlyHint, idempotentHint and destructiveHint=false already declared, the safety profile is covered. The description goes further by disclosing operational behavior the annotations cannot: iteration and match counts are hard-capped, a worker thread is terminated on budget expiry against pathological patterns, and a ReDoS risk assessment is returned. These are real behavioral traits beyond structured data.

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?

Three sentences, no filler, and the primary capability is front-loaded before the safety and response details. Tight and well-ordered, though the middle sentence about caps could be folded into the parameter documentation.

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?

There is no output schema, so the description carries the return-value burden and does so by naming the match index, capture groups and named groups. It also covers failure-mode behavior with the cap and deadline narrative. The only real gap is the absent routing versus regex_analyze.

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 all five parameters (text, pattern, flags, budgetMs, maxMatches) are already documented in the schema, including defaults and the worker-termination semantics for budgetMs. The description adds only a general note about match capping, which the schema already states for maxMatches, so it earns the baseline rather than more.

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?

The description states a specific verb and resource (apply a regex, return every match) and even enumerates the return shape: match index, numbered capture groups, named groups. This is far more than a restatement of the name. It does not, however, distinguish itself from the sibling regex_analyze, which is the closest competing tool.

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 explicit when-to-use guidance and no mention of the sibling regex_analyze, which appears to be the nearest alternative for regex work. An agent must infer from context alone whether it should extract matches or analyze the pattern.

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