Skip to main content
Glama
yuplin2333

MCP Long Context Reader

by yuplin2333

search_with_regex

Search long documents for a regex pattern to extract matching snippets. Provide a file path or text content to find exactly what you need without loading the entire document.

Instructions

Searches a document for a regex pattern and returns matching snippets.
Exactly one of context_path or context_text must be provided. Do NOT provide both.

Args:
    context_path (str, optional): The path to the context file.
    context_text (str, optional): The text content to search.
    regex_pattern (str, optional): The regex pattern to search for.
    case_sensitive (bool, default=True): Whether to match case-sensitively.

Returns:
    str: A string containing the matching snippets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_pathNo
context_textNo
regex_patternNo
case_sensitiveNo
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the exclusivity constraint and the return type, but does not explicitly state whether the operation is read-only or what happens if both inputs are provided, and error behaviors are undocumented.

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: a one-sentence summary, a constraint, a compact Args list, and a Returns line. No redundant fluff—every element contributes to understanding or correct usage.

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?

The description covers the core purpose, all parameters, the exclusivity constraint, and the return type, which is sufficient for a straightforward regex search tool. It lacks only minor edge-case behavior like error handling and exact snippet formatting, but these are not essential for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description fully compensates by documenting all four parameters with clear meanings, including the default for case_sensitive. It also specifies the mutual exclusivity of context_path and context_text, which is critical for correct invocation.

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 uses a specific verb ('Searches') and resource ('a document for a regex pattern'), clearly distinguishing it from sibling tools that summarize or retrieve via RAG. It unambiguously conveys the tool's function.

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 description clearly states the tool is for regex searching, which distinguishes it from summarization and RAG siblings. However, it does not explicitly mention when not to use it or name alternatives. It provides strong parameter-level guidance ('Exactly one of context_path or context_text must be provided') but lacks tool-level exclusion criteria.

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/yuplin2333/mcp-long-context-reader'

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