Skip to main content
Glama
rusiaaman
by rusiaaman

BashCommand

Destructive

Execute bash commands, check status, and manage background processes with interactive controls. Stateful shell execution for efficient automation.

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"
send_textNoSet only if type="send_text"
thread_idYes
send_asciiNoSet only if type="send_ascii"
status_checkNoSet only if type="status_check"
bg_command_idNoSet only if type!="command" and doing action on a running background command
is_backgroundNoSet only if type="command" and running the command in background
send_specialsNoSet only if type="send_specials"
wait_for_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.6.6
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed11 schema fields changedv5.6.2
    • removedInput schema / $defs
      Removed value: -{
      -  "ActionJsonSchema": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "bg_command_id": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Set only if type!=\"command\" and doing action on a running background command"
      -      },
      -      "command": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Set only if type=\"command\""
      -      },
      -      "is_background": {
      -        "default": false,
      -        "description": "Set only if type=\"command\" and running the command in background",
      -        "type": "boolean"
      -      },
      -      "send_ascii": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "integer"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Set only if type=\"send_ascii\""
      -      },
      -      "send_specials": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "enum": [
      -                "Enter",
      -                "Key-up",
      -                "Key-down",
      -                "Key-left",
      -                "Key-right",
      -                "Ctrl-c",
      -                "Ctrl-d"
      -              ],
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Set only if type=\"send_specials\""
      -      },
      -      "send_text": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Set only if type=\"send_text\""
      -      },
      -      "status_check": {
      -        "anyOf": [
      -          {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Set only if type=\"status_check\""
      -      },
      -      "type": {
      -        "description": "type of action.",
      -        "enum": [
      -          "command",
      -          "status_check",
      -          "send_text",
      -          "send_specials",
      -          "send_ascii"
      -        ],
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "type"
      -    ],
      -    "type": "object"
      -  }
      -}
    • removedInput schema / properties / action_json
      Removed value: -{
      -  "$ref": "#/$defs/ActionJsonSchema"
      -}
    • addedInput schema / properties / bg_command_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only if type!=\"command\" and doing action on a running background command"
      +}
    • addedInput schema / properties / command
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only if type=\"command\""
      +}
    • addedInput schema / properties / is_background
      Added value: +{
      +  "default": false,
      +  "description": "Set only if type=\"command\" and running the command in background",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / send_ascii
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only if type=\"send_ascii\""
      +}
    • addedInput schema / properties / send_specials
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "enum": [
      +          "Enter",
      +          "Key-up",
      +          "Key-down",
      +          "Key-left",
      +          "Key-right",
      +          "Ctrl-c",
      +          "Ctrl-d"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only if type=\"send_specials\""
      +}
    • addedInput schema / properties / send_text
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only if type=\"send_text\""
      +}
    • addedInput schema / properties / status_check
      Added value: +{
      +  "anyOf": [
      +    {
      +      "const": true,
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only if type=\"status_check\""
      +}
    • addedInput schema / properties / type
      Added value: +{
      +  "description": "type of action.",
      +  "enum": [
      +    "command",
      +    "status_check",
      +    "send_text",
      +    "send_specials",
      +    "send_ascii"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "action_json",
      -  "thread_id"
      -]New value: +[
      +  "type",
      +  "thread_id"
      +]
  3. Changed2 schema fields changedv1.0.0
    • addedInput schema / $defs / ActionJsonSchema / properties / bg_command_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only if type!=\"command\" and doing action on a running background command"
      +}
    • addedInput schema / $defs / ActionJsonSchema / properties / is_background
      Added value: +{
      +  "default": false,
      +  "description": "Set only if type=\"command\" and running the command in background",
      +  "type": "boolean"
      +}
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Even with annotations already signalling open and destructive behavior, the description adds substantial operational detail: commands are stateful, status and cwd are always returned, output may be truncated, background commands run in new non-reusable shells, and status must be polled before interrupting. These behaviors go well beyond what the annotations convey.

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 bulleted format is front-loaded with the most critical caveat (statefulness) and each subsequent bullet carries actionable information for a high-complexity tool. There is minor redundancy between the one-command-at-a-time and wait-for-previous bullets, but overall the length is warranted by the tool's parameter count and interactive modes.

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?

For a 10-parameter tool with no output schema, the description does well to state that status and cwd are returned and to cover truncation, backgrounding, and status polling. The main gap is that the interactive input modes (send_text, send_ascii, send_specials) and wait_for_seconds are never explained in context, so an agent may not know how to drive an already-running command.

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?

With roughly 80% schema coverage the baseline is 3, but the description adds useful parameter semantics: status_check must be called with an empty command argument, bg_command_id is the handle for interacting with a background command, and only one command may run at a time. However, it does not explain wait_for_seconds or how send_text/send_ascii/send_specials should be used with a running process.

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 'Execute a bash command', a specific verb+resource, and immediately distinguishes the tool from file-focused siblings by forbidding echo/cat and directing the agent to ReadFiles/FileWriteOrEdit. It also clarifies stateful execution, which sets expectations beyond what the name alone implies.

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?

It clearly names ReadFiles/FileWriteOrEdit as the alternatives for file I/O and instructs against shell backgrounding with '&'. It lacks an explicit 'when not to use' statement for the other sibling tools, and the background instruction ('instead use this tool') is slightly ambiguous, though the intent is recoverable from the schema's is_background field.

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