Skip to main content
Glama
Bridge Commander
by PaPasha215

search_code

Read-onlyIdempotent

Search file contents by regex or plain text to locate code matches and return path, line, and text, with optional file pattern filtering.

Instructions

Search file contents with a regular expression (or literal=true for plain text). Returns path:line:text. file_pattern filters names, e.g. *.ts.

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": {
      "path": "<path>",
      "pattern": "<pattern>"
    },
    "name": "search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
literalNo
patternYes
timeout_msNoMilliseconds to wait for output.
ignore_caseNo
max_resultsNo
file_patternNo
context_linesNo
include_hiddenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/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 and the description does not need to restate it. The description adds one genuinely new behavior detail, the 'path:line:text' return shape, but says nothing about result caps, hidden-file handling, or timeouts. With annotations carrying the safety burden, this is adequate but thin for a 9-parameter search.

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?

Three short sentences, no filler, and the two most decision-relevant facts (matching mode and return format) are front-loaded. Every clause carries information an agent would otherwise have to guess.

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

Completeness3/5

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

There is no output schema, so the description usefully supplies the return format, which covers the biggest hole. However, for a read-only search with nine parameters and no documented caps, an agent still cannot tell whether results are truncated, whether searching the whole filesystem is bounded, or what ignore_case and include_hidden actually toggle.

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 only 11% (just timeout_ms), so the description must compensate and it partly does: it defines pattern as a regular expression, literal=true as plain-text matching, and file_pattern as a name filter with a '*.ts' example. That leaves path, ignore_case, max_results, context_lines and include_hidden undocumented in both places, which is a real gap for a search tool where context_lines and max_results change output shape substantially.

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?

The description opens with a specific verb and resource ('Search file contents') and immediately qualifies the matching mode (regex vs. literal=true), which tells an agent this is a content search rather than a filename search. It never names a sibling such as search_files, so the differentiation is implied by the resource ('contents') rather than stated explicitly.

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?

The parenthetical '(or literal=true for plain text)' is a usable selection hint between two matching modes, and 'file_pattern filters names' implies its use. There is no explicit guidance on when to choose this over search_files, when to raise max_results or timeout_ms, or what to do if results are truncated.

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