Skip to main content
Glama
office233
by office233

search_code

Read-onlyIdempotent

Search file contents by regex or literal text across a workspace, returning path:line:text matches with optional surrounding context lines.

Instructions

Search file contents with a regex (ripgrep when installed, Node fallback otherwise). Returns path:line: text; context adds surrounding lines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoFile filter, e.g. "*.ts"
pathNoDirectory to search (default: default workspace)
queryYesRegex (or literal text with literal: true)
contextNo
literalNo
maxResultsNo
caseSensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.1

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds genuinely new context: the ripgrep-vs-Node backend fallback and the return shape 'path:line: text'. It omits any mention of maxResults truncation or rate/performance behavior, keeping it short of 5.

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 tight sentences, front-loaded with the core action, then the return format. Zero wasted words.

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?

No output schema, but the description supplies the return format and context behavior. For a 7-param read tool this is nearly complete, with the minor gap being maxResults truncation semantics.

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 coverage is 43%, so the description must compensate. It clarifies the 'query' semantics (regex, or literal with literal: true) and explains 'context' (surrounding lines), which the schema leaves bare. However, maxResults and caseSensitive remain undocumented in both places.

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 file contents with a regex.' The phrase 'file contents' implicitly separates it from find_files (filename search), but no sibling is named explicitly.

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 when-not, and no routing to alternatives like find_files or find_symbol. The agent must infer from the 'file contents' scope that this is content search.

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

Deploy Server

Other Tools