Skip to main content
Glama
nickgnd

Tmux MCP Server

by nickgnd

split-pane

Split tmux terminal panes horizontally or vertically to manage multiple terminal sessions within a single window. Control pane size percentages for efficient workspace organization.

Instructions

Split a tmux pane horizontally or vertically

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paneIdYesID of the tmux pane to split
directionNoSplit direction: 'horizontal' (side by side) or 'vertical' (top/bottom). Default is 'vertical'
sizeNoSize of the new pane as percentage (1-99). Default is 50%

Implementation Reference

  • Core handler function that implements the split-pane logic by constructing tmux 'split-window' command with direction and size options, executing it, and returning the new pane details.
    export async function splitPane(
      targetPaneId: string,
      direction: 'horizontal' | 'vertical' = 'vertical',
      size?: number
    ): Promise<TmuxPane | null> {
      // Build the split-window command
      let splitCommand = 'split-window';
    
      // Add direction flag (-h for horizontal, -v for vertical)
      if (direction === 'horizontal') {
        splitCommand += ' -h';
      } else {
        splitCommand += ' -v';
      }
    
      // Add target pane
      splitCommand += ` -t '${targetPaneId}'`;
    
      // Add size if specified (as percentage)
      if (size !== undefined && size > 0 && size < 100) {
        splitCommand += ` -p ${size}`;
      }
    
      // Execute the split command
      await executeTmux(splitCommand);
    
      // Get the window ID from the target pane to list all panes
      const windowInfo = await executeTmux(`display-message -p -t '${targetPaneId}' '#{window_id}'`);
    
      // List all panes in the window to find the newly created one
      const panes = await listPanes(windowInfo);
    
      // The newest pane is typically the last one in the list
      return panes.length > 0 ? panes[panes.length - 1] : null;
    }
  • src/index.ts:315-344 (registration)
    MCP tool registration for 'split-pane', defining input schema with Zod and wrapper handler that delegates to tmux.splitPane and formats response.
    server.tool(
      "split-pane",
      "Split a tmux pane horizontally or vertically",
      {
        paneId: z.string().describe("ID of the tmux pane to split"),
        direction: z.enum(["horizontal", "vertical"]).optional().describe("Split direction: 'horizontal' (side by side) or 'vertical' (top/bottom). Default is 'vertical'"),
        size: z.number().min(1).max(99).optional().describe("Size of the new pane as percentage (1-99). Default is 50%")
      },
      async ({ paneId, direction, size }) => {
        try {
          const newPane = await tmux.splitPane(paneId, direction || 'vertical', size);
          return {
            content: [{
              type: "text",
              text: newPane
                ? `Pane split successfully. New pane: ${JSON.stringify(newPane, null, 2)}`
                : `Failed to split pane ${paneId}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error splitting pane: ${error}`
            }],
            isError: true
          };
        }
      }
    );
  • Zod input schema for the split-pane tool parameters: paneId (required string), direction (optional enum), size (optional number 1-99).
      paneId: z.string().describe("ID of the tmux pane to split"),
      direction: z.enum(["horizontal", "vertical"]).optional().describe("Split direction: 'horizontal' (side by side) or 'vertical' (top/bottom). Default is 'vertical'"),
      size: z.number().min(1).max(99).optional().describe("Size of the new pane as percentage (1-99). Default is 50%")
    },
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 states the action ('split') but doesn't disclose behavioral traits such as whether this requires tmux session permissions, if it's destructive to the original pane, what happens on success/failure, or any rate limits. The description is minimal and lacks essential context for a mutation tool.

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 directly states the tool's purpose without waste. It's appropriately sized and front-loaded, making it easy to understand at a glance. Every word earns its place.

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 complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like effects on the tmux session, error handling, or return values. For a tool that modifies state, more context is needed to ensure safe and correct usage.

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?

The description adds no parameter semantics beyond what the input schema provides. The schema has 100% description coverage, with clear details for 'paneId', 'direction' (including enum and default), and 'size' (range and default). Since schema coverage is high, the baseline is 3, and the description doesn't compensate with additional meaning.

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 ('split') and resource ('tmux pane'), specifying it can be done 'horizontally or vertically'. It distinguishes from siblings like 'create-window' or 'kill-pane' by focusing on splitting existing panes. However, it doesn't explicitly differentiate from similar tools like 'create-window' in terms of scope.

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 existing pane), exclusions, or comparisons to siblings like 'create-window' for new windows versus splitting panes. Usage is implied but not explicitly stated.

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