Skip to main content
Glama

Bash syntax check (structured)

bash_syntax_check
Read-only

Checks shell scripts for syntax errors with bash -n without executing them, returning structured diagnostics with file, line, and message so you can validate untrusted scripts safely.

Instructions

Check shell scripts for syntax errors with bash -n and return structured diagnostics (file, line, message). Parses without executing, so it is safe on untrusted scripts. Reports valid:true when no errors are found.

Input Schema

NameRequiredDescriptionDefault
filesNoRequired. Shell script path(s) to check; a string or array
maxItemsNoItem cap; overrides detailLevel
detailLevelNoItem preset: summary 20, normal 100, full (default; also skips the response budget)

Output Schema

NameRequiredDescriptionDefault
totalNo
validYes
errorsYes
retainedNo
truncatedNo
errorCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the `readOnlyHint` annotation, the description explains that it uses `bash -n`, does not execute code, is safe on untrusted scripts, and reports `valid:true` when clean. It adds meaningful safety and output behavior context, though it does not describe edge cases such as unreadable or missing files.

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 short sentences with no filler. The core action, safety property, and success signal are front-loaded and easy to scan.

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?

The tool is simple, annotations already indicate read-only behavior, the output schema exists, and parameter documentation is complete in the schema. The description is largely sufficient, though it could mention when this syntax-only check is preferable to `bash_lint` or `bash_test`.

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 the schema already documents `files`, `maxItems`, and `detailLevel`. The description adds no parameter-level guidance beyond what is already structured, which is the baseline 3 case.

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 gives a specific verb and resource: checking shell scripts for syntax errors with `bash -n`, plus the shape of the diagnostics. It is clear what the tool does, but it does not explicitly differentiate itself from siblings such as `bash_lint` or `bash_test`.

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 description implies usage by noting that it parses without executing and is safe on untrusted scripts. However, it does not explicitly state when to choose this over `bash_lint`, `bash_test`, or `run`, nor does it give exclusion conditions.

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