Skip to main content
Glama

tmux_list_panes

List all panes in a tmux session with their index, size, and active status for terminal automation and session management.

Instructions

List all panes in a tmux session with their details (index, size, active status).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_nameYesName of the tmux session

Implementation Reference

  • Handler function that executes the tmux_list_panes tool by running 'tmux list-panes' command, parsing output into JSON array of pane details.
    async listPanes(args) {
      const { session_name } = args;
    
      try {
        const { stdout } = await execAsync(
          `tmux list-panes -t "${session_name}" -F '#{pane_index}|#{pane_width}x#{pane_height}|#{pane_active}|#{pane_current_command}'`
        );
    
        const panes = stdout
          .trim()
          .split("\n")
          .map((line) => {
            const [index, size, active, command] = line.split("|");
            return {
              index: parseInt(index),
              size,
              active: active === "1",
              command,
            };
          });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(panes, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to list panes: ${error.message}`);
      }
    }
  • Tool schema definition including name, description, and input schema requiring 'session_name'.
    {
      name: "tmux_list_panes",
      description:
        "List all panes in a tmux session with their details (index, size, active status).",
      inputSchema: {
        type: "object",
        properties: {
          session_name: {
            type: "string",
            description: "Name of the tmux session",
          },
        },
        required: ["session_name"],
      },
    },
  • src/index.js:205-205 (registration)
    Registration in the switch statement dispatching calls to the listPanes handler.
    case "tmux_list_panes":
  • src/index.js:37-184 (registration)
    Tool is registered in the ListToolsRequestHandler by including it in the tools array.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: "tmux_create_session",
          description:
            "Create a new tmux session. If no name is provided, tmux will generate one. Returns session name.",
          inputSchema: {
            type: "object",
            properties: {
              session_name: {
                type: "string",
                description: "Name for the tmux session (optional)",
              },
              start_directory: {
                type: "string",
                description: "Starting directory for the session (optional)",
              },
            },
          },
        },
        {
          name: "tmux_list_sessions",
          description:
            "List all active tmux sessions with their details (name, windows, created time, attached status).",
          inputSchema: {
            type: "object",
            properties: {},
          },
        },
        {
          name: "tmux_send_keys",
          description:
            "Send keys/commands to a tmux session. Automatically appends Enter unless literal mode is specified.",
          inputSchema: {
            type: "object",
            properties: {
              session_name: {
                type: "string",
                description: "Name of the tmux session",
              },
              keys: {
                type: "string",
                description: "Keys or command to send to the session",
              },
              literal: {
                type: "boolean",
                description:
                  "If true, send keys literally without appending Enter (default: false)",
              },
            },
            required: ["session_name", "keys"],
          },
        },
        {
          name: "tmux_capture_pane",
          description:
            "Capture the visible content of a tmux pane. Returns the text currently displayed in the pane.",
          inputSchema: {
            type: "object",
            properties: {
              session_name: {
                type: "string",
                description: "Name of the tmux session",
              },
              pane_index: {
                type: "string",
                description: "Pane index (default: 0 for main pane)",
              },
              lines: {
                type: "number",
                description:
                  "Number of lines to capture from scrollback (default: captures visible area, use -1 for entire scrollback)",
              },
            },
            required: ["session_name"],
          },
        },
        {
          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"],
          },
        },
        {
          name: "tmux_split_window",
          description:
            "Split the current window in a tmux session horizontally or vertically to create a new pane.",
          inputSchema: {
            type: "object",
            properties: {
              session_name: {
                type: "string",
                description: "Name of the tmux session",
              },
              vertical: {
                type: "boolean",
                description:
                  "If true, split vertically (side by side). If false, split horizontally (top and bottom). Default: false",
              },
            },
            required: ["session_name"],
          },
        },
        {
          name: "tmux_select_pane",
          description:
            "Select a specific pane in a tmux session to make it active for commands.",
          inputSchema: {
            type: "object",
            properties: {
              session_name: {
                type: "string",
                description: "Name of the tmux session",
              },
              pane_index: {
                type: "string",
                description: "Pane index to select (e.g., '0', '1', '2')",
              },
            },
            required: ["session_name", "pane_index"],
          },
        },
        {
          name: "tmux_list_panes",
          description:
            "List all panes in a tmux session with their details (index, size, active status).",
          inputSchema: {
            type: "object",
            properties: {
              session_name: {
                type: "string",
                description: "Name of the tmux session",
              },
            },
            required: ["session_name"],
          },
        },
      ],
    }));
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the output details (index, size, active status) but lacks information on permissions needed, error handling (e.g., if session_name is invalid), or response format. This is a significant gap for a tool with mutation potential in tmux environments.

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 that front-loads the core action and includes essential details without waste. Every word contributes to understanding the tool's purpose, making it appropriately sized and structured.

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 low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks behavioral context like error handling or output specifics, which would be needed for full agent understanding. It meets the minimum viable threshold but has clear gaps.

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 single parameter 'session_name' well-documented in the schema. The description does not add any parameter-specific details beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate as the schema handles the parameter documentation adequately.

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 clearly states the action ('List all panes') and the resource ('in a tmux session'), specifying what details are included (index, size, active status). It distinguishes from siblings like tmux_list_sessions by focusing on panes rather than sessions, but doesn't explicitly contrast with tmux_capture_pane or tmux_select_pane, which also involve panes.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't clarify if this should be used for general pane inspection versus tmux_capture_pane for content retrieval or tmux_select_pane for interaction. The description implies usage by stating the purpose but offers no explicit context or exclusions.

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