Skip to main content
Glama

regex_lint

Read-onlyIdempotent

Static safety analysis of a regular expression plus an English explanation of what it matches. Parses the pattern into an AST and flags the structures that cause catastrophic backtracking (ReDoS): nested unbounded quantifiers like (a+)+, repeated alternations whose branches can start with the same character like (a|ab)*, adjacent unbounded quantifiers over overlapping character sets like \d+\d+, and implausibly large bounded repeats. The pattern is COMPILED but never EXECUTED against input - running a caller-supplied regex is itself the denial-of-service vector. Detection is a structural heuristic, so a risk of "none" means no known dangerous shape was found, not a proof of safety. Deterministic, no LLM.

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>"
    },
    "name": "regex_lint"
  }
}

Input Schema

NameRequiredDescriptionDefault
flagsNoOptional inline flags, any of "imsxau" (ignorecase, multiline, dotall, verbose, ascii, unicode).
patternYesThe regular expression source, without delimiters. Max 2,000 characters.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description adds substantial behavior the annotations cannot convey: the pattern is compiled but never executed, detection is a structural AST heuristic, 'none' is not a safety proof, and the tool is deterministic with no LLM. The security rationale for non-execution is exactly the kind of context an agent needs.

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?

Purpose is front-loaded, then the detection classes, then the critical non-execution guarantee, then the heuristic caveat. Every sentence contributes information; none restates the title or the schema.

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?

With no output schema, the description does explain that a match explanation is returned and that risk can read 'none' as a non-absolute signal. It stops short of describing the actual response shape (risk levels, field names), which leaves a small gap for a tool whose primary output is a report.

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 coverage is 100%, so both `pattern` (source, no delimiters, 2,000 char max) and `flags` (imsxau) are fully documented in the schema. The description adds no further parameter semantics such as flag precedence or interaction with inline flags, so the 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?

Opens with a specific verb+resource: 'Static safety analysis of a regular expression plus an English explanation of what it matches.' It also enumerates the exact dangerous structures it detects, which makes it unmistakable against lint-style siblings like mcp_tool_lint or story_lint.

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 context for use is clear: analyze a caller-supplied pattern for ReDoS risk before running it. It does not name an alternative tool or state explicit when-not conditions, but the scope is narrow enough that routing ambiguity is low.

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.