Skip to main content
Glama

ParecodeSearch

Search code using ripgrep to find regex matches with surrounding context in one call, merging overlapping windows and providing token estimates.

Instructions

Search the codebase with ripgrep and get matches plus surrounding context in ONE call — use instead of Grep/Glob-then-Read, a raw rg/grep in the shell, or re-reading the same file at different line ranges. Pass pattern as an array to run several regexes in parallel for flow tracing (e.g. ['HandleX','OnX','XClosed']); each match lists which patterns hit it. Overlapping or adjacent windows in a file are merged (gap ≤ contextLines), and the result carries one envelope-level estimatedTokens so you can budget before consuming. Read-only: to widen a match use ParecodeExpand, to change code use ParecodeEdit. Per-file content over ~2KB is dropped (its lines listed in omittedLineRanges) to protect context — widen those via ParecodeExpand instead of re-reading the file. Repeated calls in the same session are token-efficient: previously-returned windows return as kind: 'reference' placeholders. Watch the warnings field — a pattern_directory_collision almost always means narrow the pattern before retrying. Needs ripgrep on PATH (run parecode doctor if missing). In CodeGraph repos (.codegraph/), prefer codegraph_explore for broad 'how does X work?' questions; this stays best for targeted multi-pattern lookups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesRipgrep regex pattern, or an array of patterns to dispatch in parallel. Each match reports which input pattern(s) contributed via 'patterns'.
pathsNoDirectory or file paths to restrict the search. Defaults to the current working directory.
contextLinesNoNumber of context lines to include around matches. Defaults to 2. Also controls window-merge threshold within a file.
maxBytesPerFileNoSoft cap on bytes returned per file; above it, output is chunked around match centers and the trimmed lines are reported in omittedLineRanges (widen them with ParecodeExpand).
relatedSymbolsNoOpt-in: scan each match's content for likely related symbols (Handle<X>, On<X>, <X>Handler, <X>Listener, <X>Closed/Completed/Started). Returns deduped, lexically sorted, capped at 10 per match.
Behavior5/5

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

Discloses read-only nature, per-file content truncation over 2KB with omittedLineRanges, token-efficient repeated calls returning references, envelope-level estimatedTokens, and prerequisite of ripgrep on PATH. No annotations present, so description fully carries the burden.

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?

Well-structured with clear front-loading of main purpose and alternatives. Each sentence adds value, though slightly lengthy. Could be trimmed slightly without losing essential info.

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?

Completely covers complex tool behaviors including edge cases (pattern_directory_collision), performance considerations, integration instructions (parecode doctor), and fallback strategies. No obvious gaps given complexity and no output schema.

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 covers all 5 parameters with descriptions. Description adds practical usage context like parallel dispatch for pattern arrays, window-merge threshold for contextLines, chunking behavior for maxBytesPerFile, and scanning logic for relatedSymbols, enriching meaning beyond 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?

Clearly states 'Search the codebase with ripgrep and get matches plus surrounding context in ONE call', specifies verb and resource, and differentiates from sibling tools (ParecodeEdit, ParecodeExpand) and alternatives.

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?

Explicitly says when to use (instead of Grep/Glob-then-Read, raw rg/grep, re-reading files), when not to (for broad questions use codegraph_explore), and provides guidance on pattern arrays and warnings.

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/BasilSkyWalk/parecode'

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