Skip to main content
Glama

search_code

Read-onlyIdempotent

Search a project's codebase by pattern and receive graph-ranked compact symbols, bounded source, or file paths.

Instructions

Graph-ranked text search: compact symbols, full bounded source, or file paths.

Input Schema

NameRequiredDescriptionDefault
modeNocompact
debugNoAdd scope_ms/scan_ms/enrich_ms phase timings.
limitNo
regexNo
formatNotree
contextNo
patternYes
projectYes
raw_limitNo
raw_offsetNo
match_limitNo
path_filterNo
file_patternNo
result_limitNo
result_offsetNo
directory_limitNo
directory_offsetNo
source_max_linesNo
max_output_tokensNo
raw_content_offsetNoRaw-line byte offset; omit for match-centered preview.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.12.1
    • addedInput schema / properties / context / default
      Added value: +0
    • addedInput schema / properties / context / maximum
      Added value: +200
    • addedInput schema / properties / context / minimum
      Added value: +0
  2. Changed18 schema fields changedv0.11.0
    • removedInput schema / properties / context / description
      Removed value: -"Lines of context around each match (like grep -C). Only used in compact mode."
    • addedInput schema / properties / debug
      Added value: +{
      +  "default": false,
      +  "description": "Add scope_ms/scan_ms/enrich_ms phase timings.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / directory_limit
      Added value: +{
      +  "default": 20,
      +  "maximum": 64,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / directory_offset
      Added value: +{
      +  "default": 0,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • removedInput schema / properties / file_pattern / description
      Removed value: -"Glob for grep --include (e.g. *.go)"
    • addedInput schema / properties / format
      Added value: +{
      +  "default": "tree",
      +  "enum": [
      +    "tree",
      +    "json"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / limit / description
      Removed value: -"Max enriched results per call. Default 10. Response includes 'total_grep_matches' and 'total_results' so callers can detect truncation. No offset parameter — raise limit or narrow with file_pattern / path_filter to see more."
    • addedInput schema / properties / limit / maximum
      Added value: +500
    • addedInput schema / properties / match_limit
      Added value: +{
      +  "default": 8,
      +  "maximum": 500,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_output_tokens
      Added value: +{
      +  "maximum": 1000000,
      +  "minimum": 128,
      +  "type": "integer"
      +}
    • removedInput schema / properties / mode / description
      Removed value: -"compact: signatures+metadata (default). full: with source. files: just file list."
    • removedInput schema / properties / path_filter / description
      Removed value: -"Regex filter on result file paths (e.g. ^src/ or \\.(go|ts)$)"
    • addedInput schema / properties / raw_content_offset
      Added value: +{
      +  "description": "Raw-line byte offset; omit for match-centered preview.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / raw_limit
      Added value: +{
      +  "default": 5,
      +  "maximum": 100,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / raw_offset
      Added value: +{
      +  "default": 0,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / result_limit
      Added value: +{
      +  "default": 10,
      +  "maximum": 500,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / result_offset
      Added value: +{
      +  "default": 0,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / source_max_lines
      Added value: +{
      +  "default": 20,
      +  "maximum": 200,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  3. Changed2 schema fields changedv0.10.4
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  4. Changed1 schema field changedv0.9.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  5. First observedv1.0.0

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds genuine context beyond that by characterizing the output shapes (compact symbols vs. full bounded source vs. file paths) and the graph-based ranking, but says nothing about truncation, token caps (max_output_tokens exists), or pagination behavior.

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?

A single tightly-packed sentence that front-loads the core operation and ranking behavior with zero filler. It is efficient, though the compression borders on under-specification rather than maximal brevity.

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

Completeness2/5

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

For a 20-parameter tool with 10% schema coverage and no output schema, the definition is far too thin: an agent cannot determine how the many pagination params interact, what units limits use, or how regex/context affect matching. The mode phrases hint at return shape but leave the parameter space essentially unexplained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 10% across 20 parameters: only debug carries a description, leaving regex, context, path_filter, file_pattern, and eight separate limit/offset pagination knobs entirely undocumented. The description loosely gestures at the three mode values but adds no syntax, format, or interaction detail to compensate for the coverage gap.

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?

States a specific verb+resource ("text search") with a distinctive ranking property ("graph-ranked") and enumerates three output shapes. It is clear enough what the tool returns, though it neither names sibling alternatives nor maps the shorthand phrases ("compact symbols", "file paths") to the actual mode enum values.

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?

No when-to-use guidance, no prerequisites, and no mention of alternatives despite siblings like search_graph, query_graph, and get_code_snippet that an agent must choose between. The mode list implies variants exist but never says which situation selects which.

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