Skip to main content
Glama

grep

Read-only

Search an agent’s stdout or error log stream with native pattern-matching arguments, returning matching lines, exit code, stdout, and stderr.

Instructions

Proxy the host's real grep binary against an agent log stream. args is passed as an argv array with no shell, e.g. ['-in', 'pattern'] or ['-c', '-E', 'a|b']. stream selects stdout or errors; that log path is appended as the final grep file operand. Returns exit code, stdout, and stderr.

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": {
      "agent_id": "<agent_id>",
      "args": "<args>"
    },
    "name": "grep"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsYes
streamNostdout
agent_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds genuinely useful behavior beyond that — no shell is used, args is a raw argv array, and the log path is appended as the final file operand — but it omits limits such as output truncation, timeouts, or failure modes when the binary is absent.

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 compact sentences with zero waste; the core mechanism (argv, no shell) is front-loaded and the examples are illustrative rather than verbose.

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?

An output schema exists, so return-value detail is optional, yet the description still notes exit code, stdout, and stderr. For a three-parameter tool this is nearly complete; the main gap is the unstated semantics of agent_id and any bounds on argument length or output size.

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 0%, so the description must carry the burden. It does well for args (argv array, no shell, worked examples) and stream (enum meaning plus the appended-path behavior), but agent_id is never explained, leaving one of three parameters 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?

The description states a specific verb and resource — proxying the host's grep binary against an agent log stream — which is far more informative than the bare name. It does not, however, distinguish this tool from nearby siblings such as grep_tmp or rip, leaving the agent to infer which to use.

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?

Usage is implied by 'against an agent log stream' and the stream selector, but there is no explicit when-to-use or when-not guidance and no named alternative. The agent must infer selection criteria from the sibling names alone.

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