Skip to main content
Glama

Bash test (structured)

bash_test

Run .bats or .sh test scripts and get structured per-case pass/fail results plus summary parsed from TAP or test output, falling back to exit-code-only when unrecognized.

Instructions

Run a shell test script — bats .bats files via --tap, or a plain .sh harness — and return structured results: per-case pass/fail plus a summary parsed from TAP or N tests, M failures output, falling back to exit-code-only when the format is unrecognized. Executes the script, so it is gated by BASH_MCP_MODE.

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory
fileNoRequired. Test script path (.bats or .sh)
timeoutNoTimeout in ms

Output Schema

NameRequiredDescriptionDefault
failedYes
passedYes
skippedYes
summaryYes
exitCodeYes
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses that the script is actually executed (arbitrary side effects), that a permission gate (BASH_MCP_MODE) applies, and how results degrade to exit-code-only for unrecognized output formats. It omits what the gate failure looks like and how timeout kills the process.

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?

Two sentences, front-loaded with the action, then the return contract, then the gating caveat. Every clause carries information; nothing is repeated from the schema or title.

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, yet the description still summarizes the return shape and the parsing fallback, which is helpful rather than redundant. Gaps remain around timeout semantics and what the BASH_MCP_MODE gate returns when it blocks execution.

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%, so 3 is the baseline, but the description adds real meaning: passing a .bats file triggers an implicit --tap invocation, and the expected harness output formats are described. cwd and timeout are left entirely to the schema, so it does not fully compensate beyond the baseline.

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?

Names a specific verb+resource ('Run a shell test script') and immediately scopes the accepted inputs (.bats via --tap, or a plain .sh harness), which cleanly separates it from siblings like bash_lint, bash_syntax_check, npm_test and python_test. An agent can pick this tool without opening the schema.

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

Usage Guidelines4/5

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

The two accepted script types are spelled out, which tells the agent what inputs qualify, and the closing clause signals that execution is mode-gated. It stops short of naming an alternative tool or stating when not to use it (e.g. use bash_lint for static checks), so it is clear context without exclusions.

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