Skip to main content
Glama

Search snapshot file contents

src_grep
Read-onlyIdempotent

Use this when you need to search for patterns in an app's source code. Returns matching lines with optional context. Supports regex patterns, glob filters, and multiple output modes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoGlob pattern to filter files (e.g., '*.ts')
pathNoDirectory path to search within
app_idYesTarget app id
contextNoLines before and after (overrides before/after_context)
patternYesRegex pattern to search for (max 500 chars)
versionNoVersion to search. Omit to use the latest stored snapshot (last_attempt_version).
output_modeNocontent=matching lines, files_with_matches=file paths only, count=match count per filecontent
line_numbersNoInclude line numbers in output
after_contextNoLines to show after each match (0-20)
max_file_sizeNoMax file size to scan in bytes (default 10MB)
before_contextNoLines to show before each match (0-20)
case_insensitiveNoEnable case-insensitive matching
continuation_tokenNoToken from previous response for pagination

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / version / description
      Previous value: -"Version to search (defaults to applied version)"New value: +"Version to search. Omit to use the latest stored snapshot (last_attempt_version)."
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior. The description adds useful behavioral context by stating that it returns matching lines, supports optional context, regex, glob filters, and output modes. It doesn't cover pagination or snapshot defaults, but those are partially documented in the schema, and no contradiction exists.

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?

The description is two front-loaded sentences with no filler: a direct use-case statement followed by a compact behavioral summary. Every phrase earns its place.

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?

With 13 params, no output schema, and read-only annotations, the description gives the core invocation context but omits snapshot/version behavior, pagination via continuation_token, and explicit output-mode details. The schema compensates for parameter definitions but not for these behavioral gaps.

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 the baseline is 3; the schema already explains all params. The description mentions regex, glob filters, and output modes, but does not add detailed parameter semantics beyond what the schema provides.

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 uses a specific verb+resource: 'search for patterns in an app's source code,' with 'Returns matching lines' making the grep semantics clear. It doesn't explicitly distinguish from sibling tools like src_glob or src_read, so it misses the sibling-differentiation criterion for a 5.

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

Usage Guidelines4/5

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

The first sentence gives an explicit trigger condition ('Use this when you need to search for patterns in an app's source code'). It does not mention when not to use it or point to alternatives such as src_glob/src_read, so it stops short of full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources