Skip to main content
Glama

search_codebase

Read-only

Find code by concept, symbol, or path using hybrid search. Enumerates matches, resolves identifiers to symbol IDs, and surfaces candidate files to read.

Instructions

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

For a how/where/why question call get_answer. Use this to enumerate
matches, resolve an identifier to a symbol_id, or find files for
get_context. Identifier or literal queries return `lines` (path, line,
kind, text; definitions first) read from live files; when `complete` is
true they are every match, so no grep is needed. `candidates` lists
distinct files to Read, best first.

Args:
    query: identifier, path, or natural language.
    limit: max results (default 5).
    mode: auto (by query shape) | symbol | path | concept | hybrid.
    kind: implementation | test | config | doc.
    symbol_kind: function | class | method | ...
    page_type: file_page | module_page.
    repo: alias, or "all" for workspace-wide.
    pattern: alias for query.

Input Schema

NameRequiredDescriptionDefault
kindNo
modeNoauto
repoNo
limitNo
queryNo
patternNo
page_typeNo
symbol_kindNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv0.60.1
    • removedInput schema / properties / kind / default
      Removed value: -null
    • removedInput schema / properties / kind / title
      Removed value: -"Kind"
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • removedInput schema / properties / mode / title
      Removed value: -"Mode"
    • removedInput schema / properties / page_type / default
      Removed value: -null
    • removedInput schema / properties / page_type / title
      Removed value: -"Page Type"
    • removedInput schema / properties / pattern / default
      Removed value: -null
    • removedInput schema / properties / pattern / title
      Removed value: -"Pattern"
    • removedInput schema / properties / query / title
      Removed value: -"Query"
    • removedInput schema / properties / repo / default
      Removed value: -null
    • removedInput schema / properties / repo / title
      Removed value: -"Repo"
    • removedInput schema / properties / symbol_kind / default
      Removed value: -null
    • removedInput schema / properties / symbol_kind / title
      Removed value: -"Symbol Kind"
    • removedInput schema / title
      Removed value: -"search_codebaseArguments"
  2. Changed3 schema fields changedv0.59.0
    • addedInput schema / properties / pattern
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Pattern"
      +}
    • addedInput schema / properties / query / default
      Added value: +""
    • removedInput schema / required
      Removed value: -[
      -  "query"
      -]
  3. Addedv0.39.0
  4. Removedv0.33.0
  5. First observedv0.1.0

TDQS

A4.8/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries the rest: it discloses that identifier/literal queries return `lines` read from live files with definitions first, that `complete=true` means no grep is needed, and that `candidates` is ordered best-first. That is real behavioral context beyond the annotations, though the existence of an output schema means some of it is reinforcement rather than new information.

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?

Front-loaded with purpose and exclusion before any detail, then a compact behavior sentence, then a structured Args block. Every clause adds routing or invocation value; nothing is repeated from the annotations or schema.

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?

Eight optional parameters, zero schema descriptions, and an output schema — the description covers all parameters, the return-shape routing (`lines` vs `candidates`), and the completeness guarantee. An agent has everything needed to choose the right mode and interpret the result.

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% and the schema declares no enums, so the description does all the work — and it does it: every one of the eight parameters gets meaning, including the mode enum (auto/symbol/path/concept/hybrid), kind values, symbol_kind, page_type, `repo` accepting "all" for workspace-wide, and `pattern` as an alias for query. This fully compensates for the empty 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?

The opening sentence names a concrete verb (find) and resource (code) and scopes it three ways: concept, symbol, path, plus 'hybrid codebase search'. It immediately distinguishes itself from the sibling get_answer, so an agent can pick between them without opening a schema.

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?

Explicit routing: 'For a how/where/why question call get_answer' states when NOT to use this tool, and the three named use cases (enumerate matches, resolve identifier to symbol_id, find files for get_context) cover when to use it. Both alternatives are named directly.

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