Skip to main content
Glama

stdbuf

Read-only

Control stdout/stderr/stdin buffering for a command (unbuffered, line-buffered, or byte size). Diagnose output delays and ordering issues in pipelines with safety timeout and dry-run preview.

Instructions

Run a command with controlled stdout/stderr/stdin buffering: 0=none (unbuffered), L=line-buffered, or a byte size. Executes as a subprocess, captures bounded stdout/stderr, and enforces a safety timeout. Use --dry_run to preview without execution. Defaults to system buffering when no mode is set. Use to diagnose buffering-related output delays or ordering issues in pipelines. Not for CPU priority control — use 'nice'. Not for time-bounded execution — use 'timeout'. See also 'nice', 'timeout'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
command_argsNoCommand and arguments to run.
dry_runNoReport without running the command.
errorNoRequested stderr buffering mode: 0, L, or a byte size.
inputNoRequested stdin buffering mode: 0, L, or a byte size.
max_output_bytesNoMaximum captured stdout/stderr bytes each.
outputNoRequested stdout buffering mode: 0, L, or a byte size.
timeoutNoSafety timeout for the command.
Behavior1/5

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

The description states the tool 'Executes as a subprocess' and 'captures bounded stdout/stderr' which are write/mutate operations, but annotations include readOnlyHint: true, which claims no side effects. This is a direct contradiction. The description does not align with annotations.

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 concise, starting with the core purpose and then providing additional details in logical order. Every sentence adds value, and it is well-organized without redundancy.

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?

Given the complexity (7 parameters, no output schema), the description covers key aspects: buffering modes, subprocess execution, output capture, timeout, and dry run. It misses details on how outputs are returned, but overall it is sufficiently complete for the tool's purpose.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (all 7 parameters described). The description adds extra context beyond schema, such as explaining buffering modes (0, L, byte size), default behavior, and the purpose of dry_run. This enhances understanding.

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 the verb 'Run a command' and the resource 'controlled stdout/stderr/stdin buffering'. It distinguishes from sibling tools like nice and timeout by specifying what it is not for. The purpose is 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 states when to use this tool ('diagnose buffering-related output delays or ordering issues in pipelines') and when not to use it ('Not for CPU priority control' and 'Not for time-bounded execution') with direct references to alternatives (nice, timeout).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/caseSHY/AI-CLI'

If you have feedback or need assistance with the MCP directory API, please join our Discord server