Skip to main content
Glama

Resize tmux Pane

tmux_resize_pane

Adjust pane dimensions in tmux sessions by specifying direction and amount to optimize terminal workspace layout.

Instructions

Resize a pane in a tmux window.

Args:

  • session (string, required): Name of the session

  • window (string or number, optional): Window index or name

  • pane (number, optional): Pane index

  • direction (string, required): Direction to resize: up, down, left, right

  • amount (number, optional): Number of cells to resize by (default: 5)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionYesName of the session
windowNoWindow index or name
paneNoPane index
directionYesDirection to resize
amountNoNumber of cells to resize by

Implementation Reference

  • The handler function executes the tmux resize-pane command based on the provided direction and amount, targeting the specified session, window, and pane.
    async ({ session, window, pane, direction, amount }) => {
      try {
        const target = formatTarget(session, window, pane);
        const dirFlag = { up: "-U", down: "-D", left: "-L", right: "-R" }[direction];
        await runTmux(`resize-pane -t "${target}" ${dirFlag} ${amount}`);
    
        return {
          content: [{ type: "text", text: `Pane resized ${direction} by ${amount} cells.` }],
          structuredContent: { success: true, direction, amount },
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
          isError: true,
        };
      }
    }
  • Zod input schema defining parameters: session (required string), window and pane (optional), direction (enum: up/down/left/right), amount (int >=1, default 5).
    inputSchema: z
      .object({
        session: z.string().min(1).describe("Name of the session"),
        window: z.union([z.string(), z.number()]).optional().describe("Window index or name"),
        pane: z.number().int().min(0).optional().describe("Pane index"),
        direction: z.enum(["up", "down", "left", "right"]).describe("Direction to resize"),
        amount: z.number().int().min(1).default(5).describe("Number of cells to resize by"),
      })
      .strict(),
  • src/index.ts:861-906 (registration)
    Full registration of the tmux_resize_pane tool with McpServer, including title, description, input schema, annotations, and handler function.
    server.registerTool(
      "tmux_resize_pane",
      {
        title: "Resize tmux Pane",
        description: `Resize a pane in a tmux window.
    
    Args:
      - session (string, required): Name of the session
      - window (string or number, optional): Window index or name
      - pane (number, optional): Pane index
      - direction (string, required): Direction to resize: up, down, left, right
      - amount (number, optional): Number of cells to resize by (default: 5)`,
        inputSchema: z
          .object({
            session: z.string().min(1).describe("Name of the session"),
            window: z.union([z.string(), z.number()]).optional().describe("Window index or name"),
            pane: z.number().int().min(0).optional().describe("Pane index"),
            direction: z.enum(["up", "down", "left", "right"]).describe("Direction to resize"),
            amount: z.number().int().min(1).default(5).describe("Number of cells to resize by"),
          })
          .strict(),
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
          openWorldHint: false,
        },
      },
      async ({ session, window, pane, direction, amount }) => {
        try {
          const target = formatTarget(session, window, pane);
          const dirFlag = { up: "-U", down: "-D", left: "-L", right: "-R" }[direction];
          await runTmux(`resize-pane -t "${target}" ${dirFlag} ${amount}`);
    
          return {
            content: [{ type: "text", text: `Pane resized ${direction} by ${amount} cells.` }],
            structuredContent: { success: true, direction, amount },
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
            isError: true,
          };
        }
      }
    );
Behavior3/5

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

Annotations already indicate this is a mutable but non-destructive operation (readOnlyHint=false, destructiveHint=false). The description adds minimal behavioral context beyond this - it doesn't explain what 'resize' means operationally, whether changes are immediate/reversible, or how it interacts with tmux's layout system.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear opening statement followed by parameter documentation. While the Args section is somewhat redundant given the schema, the overall text is appropriately sized and front-loaded with the core functionality.

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?

For a pane manipulation tool with full parameter documentation but no output schema, the description adequately covers what the tool does but lacks context about typical workflows, error conditions, or visual feedback. It's minimally complete but could better prepare an agent for real-world 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?

With 100% schema description coverage, the schema already documents all parameters thoroughly. The description's Args section essentially repeats what's in the schema without adding meaningful semantic context about parameter relationships or tmux-specific conventions.

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 specific action ('Resize a pane') and resource ('in a tmux window'), distinguishing it from sibling tools like tmux_kill_pane or tmux_select_pane. It uses precise terminology that matches the tool's domain.

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 like tmux_split_window for changing pane layout, or how it relates to other pane management tools. It lacks context about typical use cases or prerequisites.

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

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