Skip to main content
Glama
adrienthebo
by adrienthebo

search_by_regex_tool

Search Obsidian notes using regular expressions to find complex patterns like URLs, code syntax, TODO comments, and structured data with advanced matching options.

Instructions

Search for notes using regular expressions for advanced pattern matching.

When to use:

  • Finding complex patterns (URLs, code syntax, structured data)

  • Searching with wildcards and special characters

  • Case-sensitive or multi-line pattern matching

  • Finding TODO/FIXME comments with context

When NOT to use:

  • Simple text search (use search_notes instead)

  • Searching by tags or properties (use dedicated tools)

Common patterns:

  • URLs: r"https?://[^\s]+"

  • Email: r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}"

  • TODO comments: r"(TODO|FIXME)\s*:.*"

  • Markdown headers: r"^#{1,6}\s+.*"

  • Code blocks: r"\w*\n[\s\S]*?"

Returns: Notes containing regex matches with match details and context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesRegular expression pattern for advanced searches. Use for finding URLs, code patterns, TODO items, etc.
flagsNo
context_lengthNoCharacters to show around matches
max_resultsNoMaximum number of notes to return. Use smaller values for faster responses.
ctxNo
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: the tool returns 'Notes containing regex matches with match details and context,' and the 'Common patterns' section implies it supports complex regex features. However, it doesn't mention performance considerations like speed or resource usage, which could be relevant for a regex search tool.

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 well-structured with clear sections (purpose, usage guidelines, patterns, returns), front-loaded key information, and every sentence adds value (e.g., specific examples, explicit alternatives). It's appropriately sized for a tool with 5 parameters and no annotations.

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's complexity (regex-based search, 5 parameters, no annotations, no output schema), the description is mostly complete: it covers purpose, usage, parameters via examples, and output behavior. However, it lacks details on error handling, performance implications (e.g., regex complexity impact), or the 'ctx' parameter's purpose, leaving minor gaps.

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 60%, so the description must compensate. It adds significant value: the 'Common patterns' section provides concrete regex examples (e.g., for URLs, emails, TODO comments) that clarify the 'pattern' parameter beyond the schema's examples, and the 'Returns' section explains output semantics. However, it doesn't detail all parameters like 'ctx' or fully explain 'flags' 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's purpose: 'Search for notes using regular expressions for advanced pattern matching.' It specifies the verb ('search'), resource ('notes'), and method ('regular expressions'), distinguishing it from sibling tools like 'search_notes_tool' for simple text search and 'search_by_property_tool' for property-based searches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance with 'When to use' and 'When NOT to use' sections, listing specific scenarios (e.g., finding complex patterns, URLs, TODO comments) and naming alternatives ('use search_notes instead' for simple text search, 'use dedicated tools' for tags/properties). This clearly differentiates it from sibling tools.

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/adrienthebo/obsidian-mcp'

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