Skip to main content
Glama
nickgnd

Tmux MCP Server

by nickgnd

list-panes

Retrieve and display all terminal panes within a specified tmux window to manage and monitor session layout.

Instructions

List panes in a tmux window

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowIdYesID of the tmux window

Implementation Reference

  • Core handler function that executes the tmux 'list-panes' command, parses the formatted output into TmuxPane objects, and returns the list of panes.
    export async function listPanes(windowId: string): Promise<TmuxPane[]> {
      const format = "#{pane_id}:#{pane_title}:#{?pane_active,1,0}";
      const output = await executeTmux(`list-panes -t '${windowId}' -F '${format}'`);
    
      if (!output) return [];
    
      return output.split('\n').map(line => {
        const [id, title, active] = line.split(':');
        return {
          id,
          windowId,
          title: title,
          active: active === '1'
        };
      });
    }
  • src/index.ts:109-134 (registration)
    MCP tool registration for 'list-panes', including input schema (windowId: string) and thin wrapper handler that calls tmux.listPanes and returns JSON response.
    server.tool(
      "list-panes",
      "List panes in a tmux window",
      {
        windowId: z.string().describe("ID of the tmux window")
      },
      async ({ windowId }) => {
        try {
          const panes = await tmux.listPanes(windowId);
          return {
            content: [{
              type: "text",
              text: JSON.stringify(panes, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error listing panes: ${error}`
            }],
            isError: true
          };
        }
      }
    );
  • TypeScript interface defining the structure of a TmuxPane object, used as output type for listPanes.
    export interface TmuxPane {
      id: string;
      windowId: string;
      active: boolean;
      title: string;
    }
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 of behavioral disclosure. It states what the tool does but lacks critical details: whether it's read-only or has side effects, what the output format looks like (e.g., list of pane IDs, names, or statuses), error conditions, or dependencies. For a tool with zero annotation coverage, this is a significant gap in transparency.

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, clear sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, and there's no redundancy or unnecessary elaboration.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for effective use. It doesn't explain what information is returned (e.g., pane IDs, indices, active status), how errors are handled, or dependencies on tmux state. For a tool that likely returns structured data, this omission leaves the agent guessing about behavioral outcomes.

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 'windowId' fully documented in the schema. The description adds no additional parameter semantics beyond implying that listing is scoped to a specific window. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't enhance parameter understanding.

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') and resource ('panes in a tmux window'), making the purpose immediately understandable. It doesn't explicitly distinguish from siblings like 'list-windows' or 'list-sessions', but the specificity of 'panes' provides implicit differentiation. The description is not tautological and accurately reflects the tool's function.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active tmux session), contrast with similar tools like 'list-windows' or 'capture-pane', or specify use cases. The agent must infer usage from the tool name and context alone.

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

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