Skip to main content
Glama

Search codebase

search_codebase
Read-onlyIdempotent

Search the workspace for literal text or regex patterns, respecting .gitignore and skipping generated or binary files, and return matching lines with context and relative paths.

Instructions

Search the workspace with ripgrep (respects .gitignore; skips node_modules, dist, lockfiles and binaries). Returns matching lines with surrounding context and paths relative to the workspace root.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoNoRemote mode only: which allowlisted repo ("owner/repo") to operate on. Optional when only one repo is allowlisted; ignored in local mode.
queryYesText to search for. Treated literally unless is_regex is true.
is_regexNoInterpret query as a (Rust-flavored) regular expression.
path_globNoRestrict to files matching this glob, relative to the root, e.g. "src/**/*.ts" or "*.py".
max_resultsNoMaximum matches to return. Default 30.
context_linesNoLines of context before and after each match. Default 2.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
matchesYes
truncatedYes
workspaceYes
total_matchesYes
files_with_matchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds genuinely new behavioral detail: .gitignore is respected and node_modules, dist, lockfiles and binaries are skipped, plus the shape of the return (matching lines with surrounding context, workspace-relative paths). It does not mention the remote-vs-local mode distinction or any result truncation behavior.

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?

Two sentences, zero filler, with the core action front-loaded before the exclusion rules and return shape. Every clause carries information.

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?

An output schema exists, so return values need not be explained, and annotations plus a fully covered schema leave few gaps. What is missing is the local-vs-remote execution mode implied by the repo parameter and any note on result capping, but the description is otherwise sufficient to call the tool correctly.

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 six parameters are already documented in the schema, including the literal-vs-regex behavior and the repo allowlist rule. The description adds no parameter-level meaning beyond that, so the baseline 3 applies.

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?

States a specific verb and resource ("Search the workspace") and immediately qualifies the mechanism (ripgrep) and scope. An agent can tell this is a full-text code search, clearly distinct from siblings like get_docs, run_tests, or analyze_issue.

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?

There is no explicit when-to-use, when-not-to-use, or named alternative. The description says what it searches but never routes the agent away from get_docs or get_issue when those would be better. Usage is only implied by the word "workspace".

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