Skip to main content
Glama

search_codebase

Find code by concept, symbol, or path, returning ranked matches to pinpoint relevant files and symbols in a codebase.

Instructions

Find code by concept, symbol, or path — hybrid codebase search.

For QUESTIONS ("how does X work", "where is Y handled", "why is Z like
this"), call get_answer instead: it runs this same hybrid retrieval
internally and synthesizes a cited answer, so a search_codebase call
before get_answer is a wasted round-trip. Use this tool directly when you
want the raw ranked hits themselves — enumerating matches, resolving an
identifier to a symbol_id, or scoping a later get_context call.

mode="auto" (default) routes the query: identifier-shaped queries search
the indexed symbols (returns symbol_id/file/line bounds — pipe into
get_symbol), path-shaped queries resolve files (pipe into get_context),
and conceptual queries run wiki-semantic search. Mixed queries run hybrid,
symbol hits first. Decision records rank below file pages unless the query
is why-shaped.

`candidates` lists up to `limit` distinct openable file paths, best first.
Some results are pages, not files; this is what to Read.

Args:
    query: identifier, path, or natural-language query.
    limit: max results (default 5).
    page_type: restrict to one page type. Common: file_page (per-file
        docs, always present) or module_page (subsystem/concept pages).
        Any stored type filters (repo_overview, layer_page, scc_page,
        api_contract, infra_page, symbol_spotlight).
    kind: implementation | test | config | doc (concept/symbol modes).
    repo: alias, or "all" for workspace-wide.
    mode: auto | concept | symbol | path | hybrid.
    symbol_kind: filter symbol hits by kind (function|class|method|...).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNo
modeNoauto
repoNo
limitNo
queryYes
page_typeNo
symbol_kindNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations exist, so the description carries full burden. It discloses key behavior: mode auto routing, ranking decisions, that candidates are file paths, and that results may be pages rather than files. However, it does not explicitly state read-only/no side effects, and omits details like pagination or error cases, leaving a small transparency gap.

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 long but well-structured: opening purpose, contrast with get_answer, mode routing explanation, result format note, and a clean Args list. Every sentence provides operational value; the formatting with line breaks and bullets aids scanning without sacrificing completeness.

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 (7 parameters, multiple modes), the description is thorough. It covers return format (candidates, pages), how to pipe results into get_symbol/get_context, and default behaviors. The presence of an output schema reduces the need to detail return values, and the description integrates well with sibling tool workflows.

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?

Despite 0% schema description coverage, the 'Args' section explains every parameter (query, limit, page_type, kind, repo, mode, symbol_kind) with defaults, examples, and admissible values. This adds substantial meaning beyond the bare schema types and titles, fully compensating for the lack of schema-level descriptions.

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?

Opening line 'Find code by concept, symbol, or path — hybrid codebase search' clearly states the tool's function with a specific verb and resource. It distinguishes itself from sibling tools like get_answer and get_symbol by describing the hybrid search scope and return of raw ranked hits.

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 explicitly tells when NOT to use this tool ('call get_answer instead' to avoid wasted round-trip) and when to use it directly (raw hits, identifier resolution, scoping get_context). It also explains mode routing and common page_type filters, providing clear when-to-use guidance with alternatives.

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/repowise-dev/repowise'

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