Skip to main content
Glama

tmux_kill_session

Terminate a tmux session and all its windows and panes by specifying the session name. Use this tool to clean up unused terminal sessions in the Tmux MCP Server environment.

Instructions

Kill/terminate a tmux session and all its windows and panes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_nameYesName of the tmux session to kill

Implementation Reference

  • Executes the tmux_kill_session tool by running the tmux kill-session command asynchronously and returns a success message or throws an error.
    async killSession(args) {
      const { session_name } = args;
    
      try {
        await execAsync(`tmux kill-session -t "${session_name}"`);
    
        return {
          content: [
            {
              type: "text",
              text: `Killed tmux session: ${session_name}`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to kill session: ${error.message}`);
      }
    }
  • Input schema for the tmux_kill_session tool, requiring a session_name string parameter.
    inputSchema: {
      type: "object",
      properties: {
        session_name: {
          type: "string",
          description: "Name of the tmux session to kill",
        },
      },
      required: ["session_name"],
    },
  • src/index.js:114-128 (registration)
    Registers the tmux_kill_session tool in the ListTools response, including name, description, and input schema.
    {
      name: "tmux_kill_session",
      description:
        "Kill/terminate a tmux session and all its windows and panes.",
      inputSchema: {
        type: "object",
        properties: {
          session_name: {
            type: "string",
            description: "Name of the tmux session to kill",
          },
        },
        required: ["session_name"],
      },
    },
  • src/index.js:199-200 (registration)
    Dispatches to the killSession handler in the CallToolRequest switch statement.
    case "tmux_kill_session":
      return await this.killSession(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses the destructive behavior ('kill/terminate') and scope ('all its windows and panes'), which is good. However, it lacks details on permissions needed, error conditions (e.g., if session doesn't exist), or side effects (e.g., no confirmation prompt). For a destructive tool with zero annotation coverage, this is insufficient.

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 a single, efficient sentence with zero waste. It front-loads the key action ('kill/terminate') and resource, making it immediately clear. Every word earns its place by specifying the scope of destruction.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature and lack of annotations or output schema, the description is minimally adequate. It covers the basic action and scope but misses critical context like error handling, confirmation behavior, or return values. For a tool that permanently terminates resources, more completeness is needed to ensure safe use.

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%, with the parameter 'session_name' fully documented in the schema. The description adds no additional parameter information beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when the schema handles parameter documentation effectively.

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 action ('kill/terminate') and the target resource ('a tmux session and all its windows and panes'), making the purpose explicit. It distinguishes this destructive operation from sibling tools like tmux_list_sessions or tmux_create_session by specifying the irreversible nature of termination.

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 when a session needs to be terminated, but provides no explicit guidance on when to use this tool versus alternatives (e.g., tmux_list_sessions for checking sessions first) or prerequisites. It lacks warnings about irreversible effects or conditions for safe use.

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/MediocreTriumph/tmux-mcp'

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