Skip to main content
Glama

grep

grep
Read-onlyIdempotent

Find recorded trace events whose names or rendered values match a pattern. Filter by run, event kind, or function; resume from an event id to inspect calls, returns, exceptions, and line events.

Instructions

search events by name or value. Every CALL, RETURN, RAISE, HANDLED or LINE event whose name or rendered value contains the pattern; --after resumes from an event id a previous answer showed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fnNoqualname filter: exact match first, else substring
runNorun id, a unique prefix of one, or `last` (the newest trace)last
kindNokeep events of this kind only
afterNoevent ref to resume from
limitNomost rows to print
patternYessubstring matched against event names and rendered values

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.18.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already provide readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the tool is non-mutating and safe. The description adds context about the matching behavior (substring matching on names and rendered values) and the resume capability, which is not in the annotations. It does not contradict annotations, and the behavioral coverage is strong.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that states the primary function, the matching criteria, and the important resume capability. It is front-loaded with the action and purpose, with no wasted words. It is slightly dense but not overlong, earning a 4 rather than a 5 due to the use of a semicolon that could be simplified.

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

Completeness5/5

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

The tool is a read-only search with a rich schema that covers all parameters. The description covers the matching semantics and the resume feature, which is the key non-obvious behavior. Given the annotations and schema, an agent has everything needed to call it correctly. No output schema is needed as the description implies event rows are returned. It is complete.

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 parameters are described in the schema (e.g., 'pattern', 'fn', 'run', 'kind', 'after', 'limit'). The description adds value by clarifying that 'pattern' is a substring and lists the event kinds, but it duplicates schema info. It does not add new meaning beyond the schema, so a baseline 3 is appropriate.

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?

The description clearly states a specific verb ('search') and the resource ('events'), and specifies exactly which events match ('CALL, RETURN, RAISE, HANDLED or LINE event whose name or rendered value contains the pattern'). It distinguishes itself from siblings like 'tree' or 'flow' by focusing on pattern-based search across event types, making the tool's purpose unambiguous.

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

Usage Guidelines5/5

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

The description explicitly mentions the `--after` option and its use case ('resumes from an event id a previous answer showed'), indicating when to use it for continuing a previous exploration. It also implies this is the primary search tool for events, distinct from siblings like 'runs' (listing runs) or 'info' (details). This is clear enough for an agent to know when to select it.

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