Skip to main content
Glama
joutvhu

Search Code MCP

by joutvhu

search

Find code with regex, text, AST patterns, or symbols across a codebase, using filters, context, and pagination.

Instructions

High-performance unified code search engine combining ripgrep (regex/text) and ast-grep (AST patterns and YAML rules). Supports pagination with searchId and offset/limit for large results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory or file to search in (default: current directory '.').
typeNoSearch engine/type: 'regex' (default), 'text', 'ast', 'ast_rule', 'hybrid', 'symbol'regex
limitNoMaximum matches to return for this chunk (default: 50)
queryNoSearch query: plain text, regex, AST pattern, or YAML rule
offsetNoStarting index for pagination (1-based, default: 1)
contextNoNumber of context lines before and after match (-C)
fileTypeNoRipgrep file type filter, e.g. 'ts', 'py', 'rust', 'json'
languageNoTarget language (e.g. 'typescript', 'python'). If omitted, auto-detected from file extension
noIgnoreNoIf true, do NOT respect .gitignore (search ignored files). Default is false (respects .gitignore)
searchIdNoPrevious search result ID to view remaining results instantly without re-scanning
multilineNoMatch regex across multiple lines (-U)
wordMatchNoMatch whole words only (-w)
filePatternNoGlob pattern to filter files, e.g. '*.{ts,tsx}' or '!**/*.test.ts'
outputFormatNoOutput format: 'content' (default), 'compact' (file:line only), 'files_only', 'json'content
caseSensitiveNoMatch case sensitively. If omitted, smart-case is used
includeHiddenNoSearch hidden files and folders (-.)
maxLineLengthNoMax characters per line before truncating long lines (default: 500)
excludePatternNoPattern to exclude, e.g. '**/dist/**', '**/*.spec.ts'

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses the pagination model (searchId with offset/limit lets you page without re-scanning), which is genuine behavioral context beyond the schema. However, it says nothing about permissions, default ignore behavior, result limits, or output shape for a mutation-free but heavy operation.

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?

Two tightly written sentences with no filler; the identity/summary is front-loaded before the pagination detail. It could be marginally improved by folding in engine-selection guidance rather than a bare mechanics note.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 18-parameter tool with no annotations and no output schema, the description is thin on engine-selection semantics (the six-value type enum and its implications) and on default scoping/inclusion behavior. It covers paging but leaves meaningful gaps for a tool this complex.

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 description coverage is 100%, so every parameter is already documented in the schema, warranting the baseline 3. The description ties searchId/offset/limit together into a paging workflow but adds no per-parameter meaning beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: a code search engine with named backends (ripgrep for regex/text, ast-grep for AST/YAML rules). It clearly conveys what the tool does, but does not distinguish it from siblings like find_symbols or count.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus the sibling search-adjacent tools (find_symbols, count, list_files) or when each of the six search types is appropriate. Only a pagination workflow hint is offered, which is a mechanic rather than usage guidance.

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

Deploy Server

Other Tools