Skip to main content
Glama

BashCommand

Destructive

Execute bash commands with support for background tasks, status checks, and text/special key input. Returns command status and current working directory.

Instructions

  • Execute a bash command. This is stateful (beware with subsequent calls).

  • Status of the command and the current working directory will always be returned at the end.

  • The first or the last line might be (...truncated) if the output is too long.

  • Always run pwd if you get any file or directory not found error to make sure you're not lost.

  • Do not run bg commands using "&", instead use this tool.

  • You must not use echo/cat to read/write files, use ReadFiles/FileWriteOrEdit

  • In order to check status of previous command, use status_check with empty command argument.

  • Only command is allowed to run at a time. You need to wait for any previous command to finish before running a new one.

  • Programs don't hang easily, so most likely explanation for no output is usually that the program is still running, and you need to check status again.

  • Do not send Ctrl-c before checking for status till 10 minutes or whatever is appropriate for the program to finish.

  • Only run long running commands in background. Each background command is run in a new non-reusable shell.

  • On running a bg command you'll get a bg command id that you should use to get status or interact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYestype of action.
commandNoSet only if type="command"
status_checkNoSet only if type="status_check"
send_textNoSet only if type="send_text"
send_specialsNoSet only if type="send_specials"
send_asciiNoSet only if type="send_ascii"
is_backgroundNoSet only if type="command" and running the command in background
bg_command_idNoSet only if type!="command" and doing action on a running background command
wait_for_secondsNo
thread_idYes
Behavior5/5

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

Discloses statefulness, output truncation, single-command execution, need to wait for completion, and background command behavior. Adds context beyond annotations (destructiveHint, openWorldHint).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Bullet points make it scannable. Could be slightly trimmed, but every sentence adds value. Front-loaded with purpose.

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?

For a complex tool with no output schema, it explains return values (status, working directory), truncation behavior, and how to handle long-running commands. Covers all critical aspects.

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 covers 80% of parameters with descriptions. Description adds no direct parameter details but supplements with usage guidance (e.g., not to send Ctrl-c prematurely) that aids parameter selection.

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?

Clearly states 'Execute a bash command' and distinguishes from sibling tools like ReadFiles and FileWriteOrEdit by explicitly forbidding their use for file operations. Also highlights statefulness.

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?

Explicitly specifies when to use this tool (commands, background jobs) and when not to (file read/write, background with &). Provides alternatives and instructions like running pwd on errors.

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/rusiaaman/wcgw'

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