Skip to main content
Glama
k-rister

ephemeral-buffer

by k-rister

execute_and_capture

Run a shell command and capture its stdout/stderr into an ephemeral, searchable buffer, then get a concise summary with exit code, line count, and head/tail preview—without flooding context.

Instructions

Runs a shell command, captures stdout/stderr, indexes it, and returns a concise summary (exit code, line count, diff map or error signals, head/tail preview) WITHOUT flooding your prompt context with thousands of lines.

Use this for noisy tests, builds, logs, and other output that benefits from bounded capture and later search. Direct command execution is usually faster for a small, targeted inspection; use capture once output may be noisy, large, or uncertain. This is an advisory routing heuristic, not an enforced threshold. Before running, verify the command, intended repository, and working directory: an omitted cwd inherits the server process directory, and symlinks or shell expansion can target a different path than expected. This tool bounds output but does not validate command intent, path identity, or filesystem safety.

Args: command: Shell command line to execute. cwd: Optional working directory for command execution; pass an explicit validated path for repository-sensitive commands. label: Optional human-readable description/label for this capture. content_type: Content type hint - 'auto' (default, detects diff/log/text), 'diff', 'log', or 'text'. max_output_bytes: Maximum command output retained (default: configured buffer byte limit). timeout_seconds: Optional maximum runtime; timed-out commands return exit code 124.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
labelNo
commandYes
content_typeNoauto
timeout_secondsNo
max_output_bytesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it does so thoroughly. It explains that output is bounded, summarized, and indexed; timed-out commands return exit code 124; omitted cwd inherits the server process directory; and the tool does not validate command intent, path identity, or filesystem safety. These are exactly the behavioral caveats an agent needs before invoking a command execution tool.

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 appropriately structured: a concise main behavior paragraph, a routing and safety paragraph, and a clear Args breakdown. Every sentence earns its place, and the most important caveats are front-loaded before parameter details. It is detailed without being bloated.

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 description covers the tool's return shape (exit code, line count, diff map or error signals, head/tail preview), behavioral limits, timeout behavior, parameter defaults, and safety warnings. Given the presence of an output schema, return-value details need not be fully restated. The description is complete enough for an agent to safely and correctly invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 compensate, and it does. It provides an Args section that gives meaningful semantics for all six parameters: command is the shell command line; cwd should be an explicit validated path; content_type lists allowed hints and defaults; max_output_bytes controls retained output; timeout_seconds sets runtime and notes exit code 124. This adds substantial meaning beyond the bare input schema.

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 opens with a specific verb and resource: 'Runs a shell command, captures stdout/stderr, indexes it, and returns a concise summary.' It clearly distinguishes the tool from a direct command execution path and from capture-only tools by describing the bounded, indexed capture behavior. The purpose is unmistakable even without seeing sibling definitions.

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 tells the agent when to use this tool: for noisy tests, builds, logs, and output that benefits from bounded capture and later search. It also states when not to use it, saying direct command execution is usually faster for small, targeted inspection, and frames the guidance as an advisory routing heuristic. This gives clear, actionable selection criteria.

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