Skip to main content
Glama

search_codebase

Search codebases for regex patterns with ripgrep to locate relevant files and code. Filter by subdirectory, file glob, and case sensitivity.

Instructions

Search for a pattern in the codebase using ripgrep (supports regex)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pattern": "<pattern>"
    },
    "name": "search_codebase"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoSubdirectory to search (relative to workspace root)
patternYesSearch pattern (ripgrep regex)
file_globNoGlob to filter files, e.g. '*.ts'
case_sensitiveNoCase-sensitive search; default false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. Naming ripgrep conveys useful behavior (regex syntax, fast content scanning, likely gitignore-aware), but it says nothing about result limits, output shape, binary/large-file handling, or whether the operation is strictly read-only.

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?

One short sentence, front-loaded with the action and resource, with the parenthetical clarifying capability. Nothing is padded or redundant.

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

Completeness4/5

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

With a fully documented schema and a simple read-style search tool, the definition is close to sufficient. The remaining gap is what results look like (file paths with matching lines vs. just file lists) and any caps on matches, which an agent would want before invoking.

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 all four parameters are already documented ('ripgrep regex' for pattern, glob example for file_glob, relative path, case_sensitive default). The description's '(supports regex)' largely restates what the schema already states, adding little new meaning.

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 and resource ('Search for a pattern in the codebase') and names the underlying engine (ripgrep) with regex support, which is enough to distinguish it from symbol- or summary-oriented siblings. It stops short of explicitly contrasting itself with those siblings.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is for raw text/regex matching rather than structured symbol lookup, but there is no explicit when-to-use, when-not-to-use, or named alternative among search_symbols, search_file_summaries, or find_dead_code.

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