Skip to main content
Glama

Select tmux Pane

tmux_select_pane
Idempotent

Switch to a specific pane in a tmux window by specifying session, window, and pane indices for efficient terminal navigation.

Instructions

Switch to a specific pane in a tmux window.

Args:

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

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

  • pane (number, required): Pane index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionYesName of the session
windowNoWindow index or name
paneYesPane index

Implementation Reference

  • The main handler function for the tmux_select_pane tool. It formats the tmux target using formatTarget helper and executes the tmux select-pane command via runTmux.
    async ({ session, window, pane }) => {
      try {
        const target = formatTarget(session, window, pane);
        await runTmux(`select-pane -t "${target}"`);
    
        return {
          content: [{ type: "text", text: `Switched to pane ${pane}.` }],
          structuredContent: { success: true, session, window, pane },
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
          isError: true,
        };
      }
    }
  • Zod input schema defining the parameters for the tmux_select_pane tool: session (required string), window (optional string/number), pane (required non-negative integer).
    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).describe("Pane index"),
      })
      .strict(),
  • src/index.ts:738-779 (registration)
    Registration of the tmux_select_pane tool using server.registerTool, including the tool name, metadata (title, description, inputSchema, annotations), and the handler function.
    server.registerTool(
      "tmux_select_pane",
      {
        title: "Select tmux Pane",
        description: `Switch to a specific pane in a tmux window.
    
    Args:
      - session (string, required): Name of the session
      - window (string or number, optional): Window index or name
      - pane (number, required): Pane index`,
        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).describe("Pane index"),
          })
          .strict(),
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ session, window, pane }) => {
        try {
          const target = formatTarget(session, window, pane);
          await runTmux(`select-pane -t "${target}"`);
    
          return {
            content: [{ type: "text", text: `Switched to pane ${pane}.` }],
            structuredContent: { success: true, session, window, pane },
          };
        } 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 cover key behavioral traits (non-read-only, non-destructive, idempotent), so the description's burden is lower. It adds minimal context by implying a state change ('Switch to'), but doesn't detail effects like focus shifting or error conditions. No contradiction with annotations exists.

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 front-loaded with the core purpose in the first sentence, followed by a structured parameter list. It's efficient with minimal waste, though the parameter section could be integrated more seamlessly rather than as a separate block.

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 moderate complexity (state-changing but non-destructive), 100% schema coverage, and annotations, the description is adequate but lacks output details (no schema) and usage context. It meets minimum viability but leaves gaps in guiding the agent effectively.

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%, providing full parameter documentation. The description lists parameters with basic types but adds no meaningful semantics beyond the schema (e.g., format examples or constraints like pane indexing). Baseline 3 is appropriate as the schema handles the heavy lifting.

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 ('Switch to a specific pane') and resource ('in a tmux window'), distinguishing it from siblings like tmux_select_window (for windows) or tmux_list_panes (for listing). It precisely communicates the tool's function without ambiguity.

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. It doesn't mention prerequisites (e.g., needing an active tmux session) or differentiate from similar tools like tmux_select_window, leaving the agent to infer usage context independently.

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