Skip to main content
Glama

Search a run's full output

grep_output

Search the stored output of an earlier run with a regular expression and return matching lines with line numbers, plus optional context.

Instructions

Searches the full stored output of an earlier run with a regular expression and returns matching lines with line numbers.

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": {
      "id": "<id>",
      "pattern": "<pattern>"
    },
    "name": "grep_output"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesRun id from `run`, e.g. r3.
contextNoLines of context around each match.
patternYesRegular expression. Invalid patterns are searched as plain text.
ignore_caseNoMatch regardless of case.
max_matchesNoMost matches to show.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden, and it only discloses the read direction and the return format. It says nothing about whether results are capped (the schema's max_matches defaults to 40, so 'returns matching lines' is potentially misleading), whether non-terminated runs have output, or anything about access to another run's data.

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?

A single front-loaded sentence with zero filler: subject, verb, target, and return value in that order. Nothing is repeated and no sentence fails to earn its place.

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?

For a five-parameter read tool with no output schema and no annotations, the description covers purpose, prerequisite, and return shape, which is most of what an agent needs. The gap is silent truncation via max_matches and behavior at the match limit, which the description never hints at.

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 five parameters are already documented in the schema and the baseline of 3 applies. The description adds only the idea that `pattern` is a regex and that matches are returned with line numbers; it says nothing about context, ignore_case, or max_matches semantics beyond what the schema already states.

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?

Specific verb (searches) plus resource (full stored output of an earlier `run`) plus the return shape (matching lines with line numbers). It clearly is not `run` itself and its regex-based nature separates it from a plain read, though it never names `read_output` or `squeeze_text` to sharpen the boundary.

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 phrase 'of an earlier `run`' implies the prerequisite that a run already exists and its output is stored, and 'regular expression' implies targeted lookup rather than full reading. But there is no explicit when-to-use / when-not-to-use statement and no named alternative for the case where the agent wants the whole output rather than matches.

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