Skip to main content
Glama

Search regex (ripgrep)

search_regex
Read-only

Search Markdown vault with regex to retrieve ranked, highlighted matches from note bodies. Use glob filters to restrict file scope.

Instructions

Regex search via ripgrep. Returns ranked sandbox-wrapped match lines with term highlighting, resolved to indexed chunks. Restrict file scope with glob (e.g. '*.md'). Requires datacron index for chunk resolution. Searches note bodies only: a match inside frontmatter is not returned. The pattern uses ripgrep syntax. Without rg on PATH it falls back to scanning indexed chunk bodies with Python regex syntax, which is slower and sees only indexed content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNo
limitNo
patternYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already indicate a read-only, non-destructive operation, and the description adds significant behavioral detail beyond that: frontmatter matches are excluded, ripgrep syntax is used, and without rg on PATH it falls back to slower Python regex scanning of indexed content. This gives an agent an accurate model of what will happen.

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 compact and front-loaded: it opens with the core mechanism and result format, then covers scope restriction, requirements, exclusions, and fallback behavior in order. Every sentence adds necessary information without redundancy.

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?

Given the output schema exists, the description covers the remaining operational essentials: prerequisites, scope filtering, frontmatter exclusion, regex dialect, and fallback behavior. An agent has enough information to invoke the tool correctly and anticipate outcomes.

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 description coverage is 0%, so the description carries the parameter-explanation burden. It clearly explains glob usage with an example and states that pattern uses ripgrep syntax, adding meaning the schema lacks. The limit parameter is not explicitly described, but its name and default make it self-explanatory.

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 it performs regex search via ripgrep over note content, returning ranked, highlighted, sandbox-wrapped match lines resolved to indexed chunks. It also specifies exact scope (note bodies, not frontmatter), which distinguishes it from sibling tools like search_text.

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?

It provides concrete usage context: how to restrict file scope with glob, the dependency on datacron index, and the fallback behavior when ripgrep is unavailable. It does not explicitly name an alternative tool like search_text, but the regex-versus-text distinction is strongly implied.

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