Skip to main content
Glama
YamadaYoukai

Code Search MCP

by YamadaYoukai

search_code

Find source code text and file locations in indexed repositories. Supports filters for repository, language, and path for precise results.

Instructions

在 Zoekt 已索引的仓库中定位源码文本及其文件位置。

当用户询问符号定义或引用、错误信息来源、配置项用法、接口实现或精确 代码模式时使用。结果包含仓库、仓库内相对路径、从 1 开始的行号和命中 行片段;需要理解周围实现时,再用该结果调用 get_file_context。

query 默认按 Zoekt 查询语法解释。搜索包含空格、连字符或查询运算符的 完整错误信息、服务名或包名时设置 literal=true。已知仓库、语言或路径 范围时应使用对应过滤器,以减少无关结果。该工具只做文本/正则检索, 不执行语义分析,也不保证命中就是定义。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNo可选的语言过滤,例如 java、go 或 python
pathNo可选的仓库内文件路径正则过滤,例如 src/.*\.py
repoNo可选的仓库名正则过滤;已知目标仓库时应尽量设置
limitNo最多返回的代码命中数,默认 20,最大 100
queryYes要查找的源码文本或 Zoekt 正则表达式,例如类名、函数名、错误信息、配置键或调用表达式
literalNotrue 表示将 query 作为完整字面量,而非 Zoekt 查询语法;搜索带空格、连字符或运算符的错误信息、服务名、包名时使用

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
matchesYes
duration_msYes
Behavior4/5

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

No annotations provided, so the description bears full responsibility. It discloses that the tool performs only text/regex search, no semantic analysis, and hits are not guaranteed to be definitions. It does not mention rate limits or auth, but the behavioral limitations are well-covered.

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 efficiently structured: starts with purpose, then usage guidance, then parameter tips. Every sentence adds value, and there is no redundancy or fluff.

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 tool's complexity (6 parameters, output schema present, sibling tool), the description covers all necessary aspects: purpose, usage context, parameter behavior, limitations, and post-search workflow. It is fully adequate without ambiguity.

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 coverage is 100%, baseline 3. Description adds value by explaining default query interpretation, when to use literal=true, and provides examples for lang, path, and repo filters. This goes beyond the schema's bare definitions.

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?

Description clearly states the tool locates source code text and file locations in Zoekt-indexed repositories. It distinguishes from sibling tool get_file_context by specifying that this tool searches for code patterns, while the sibling handles context after hits are obtained.

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 provides when-to-use scenarios (symbol definitions, error messages, config usage, etc.), when-not-to-use (when understanding surrounding implementation, use get_file_context instead), and guidance on parameter usage (literal flag for special characters, filters for known scopes).

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/YamadaYoukai/CodeNavigator'

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