Skip to main content
Glama

Rename tmux Window

tmux_rename_window
Idempotent

Change the name of a tmux window to organize terminal sessions by specifying the session, window, and new name.

Instructions

Rename a window in a tmux session.

Args:

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

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

  • new_name (string, required): New window name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionYesName of the session
windowYesWindow index or current name
new_nameYesNew window name

Implementation Reference

  • The handler function that executes the tmux_rename_window tool logic, formatting the session:window target and running the 'tmux rename-window' command.
    async ({ session, window, new_name }) => {
      try {
        const target = formatTarget(session, window);
        await runTmux(`rename-window -t "${target}" "${new_name}"`);
    
        return {
          content: [{ type: "text", text: `Window '${window}' renamed to '${new_name}'.` }],
          structuredContent: { success: true, session, window, new_name },
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
          isError: true,
        };
      }
    }
  • Zod input schema defining parameters for the tmux_rename_window tool: session (string), window (string|number), new_name (string).
    inputSchema: z
      .object({
        session: z.string().min(1).describe("Name of the session"),
        window: z.union([z.string(), z.number()]).describe("Window index or current name"),
        new_name: z.string().min(1).describe("New window name"),
      })
      .strict(),
  • src/index.ts:819-859 (registration)
    Registration of the tmux_rename_window tool using server.registerTool, including title, description, input schema, annotations, and handler function.
    server.registerTool(
      "tmux_rename_window",
      {
        title: "Rename tmux Window",
        description: `Rename a window in a tmux session.
    
    Args:
      - session (string, required): Name of the session
      - window (string or number, required): Window index or current name
      - new_name (string, required): New window name`,
        inputSchema: z
          .object({
            session: z.string().min(1).describe("Name of the session"),
            window: z.union([z.string(), z.number()]).describe("Window index or current name"),
            new_name: z.string().min(1).describe("New window name"),
          })
          .strict(),
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ session, window, new_name }) => {
        try {
          const target = formatTarget(session, window);
          await runTmux(`rename-window -t "${target}" "${new_name}"`);
    
          return {
            content: [{ type: "text", text: `Window '${window}' renamed to '${new_name}'.` }],
            structuredContent: { success: true, session, window, new_name },
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
            isError: true,
          };
        }
      }
    );
  • Helper function formatTarget used by the handler to construct the tmux target string from session, window, and optional pane.
    function formatTarget(session?: string, window?: number | string, pane?: number): string {
      let target = "";
      if (session) {
        target = session;
        if (window !== undefined) {
          target += `:${window}`;
          if (pane !== undefined) {
            target += `.${pane}`;
          }
        }
      }
      return target;
Behavior3/5

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

Annotations already declare readOnlyHint=false (mutation), destructiveHint=false (non-destructive), and idempotentHint=true (safe to retry). The description adds minimal behavioral context beyond this, confirming it's a rename operation but not detailing effects (e.g., whether renaming affects window references, if names must be unique). 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 Args section. However, the Args section duplicates schema information unnecessarily, adding bulk without value. The core description is efficient, but the overall structure includes redundant content.

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 mutation tool with good annotations (idempotent, non-destructive) and full schema coverage, the description is minimally adequate. However, it lacks output information (no schema provided) and doesn't address potential errors (e.g., invalid session/window). Given the complexity of tmux operations, more context on behavior and results would be helpful.

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 each parameter clearly documented in the schema. The description repeats the same parameter information verbatim without adding extra meaning (e.g., format examples, constraints like name length limits). Baseline 3 is appropriate when the schema fully covers parameters.

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 ('Rename a window') and resource ('in a tmux session'), distinguishing it from sibling tools like tmux_rename_session (which renames sessions) and tmux_create_window (which creates new windows). The verb+resource combination is precise and unambiguous.

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., session must exist), exclusions, or comparisons to related tools like tmux_rename_session. The agent must infer usage from the tool name 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/audibleblink/tmux-mcp-server'

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