Skip to main content
Glama

Rename tmux Session

tmux_rename_session
Idempotent

Change the name of an existing tmux session to organize terminal workspaces. Provide the current session name and the new desired name.

Instructions

Rename an existing tmux session.

Args:

  • old_name (string, required): Current session name

  • new_name (string, required): New session name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
old_nameYesCurrent session name
new_nameYesNew session name

Implementation Reference

  • The asynchronous handler function for the tmux_rename_session tool. It executes the tmux rename-session command using the runTmux helper, handles errors, and returns a structured response with success status or error message.
      try {
        await runTmux(`rename-session -t "${old_name}" "${new_name}"`);
    
        return {
          content: [{ type: "text", text: `Session renamed from '${old_name}' to '${new_name}'.` }],
          structuredContent: { success: true, old_name, new_name },
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
          isError: true,
        };
      }
    }
  • Zod input schema defining required string parameters old_name (current session name) and new_name (new session name) for the tmux_rename_session tool.
    inputSchema: z
      .object({
        old_name: z.string().min(1).describe("Current session name"),
        new_name: z.string().min(1).describe("New session name"),
      })
      .strict(),
  • src/index.ts:780-817 (registration)
    Registration of the tmux_rename_session tool on the MCP server, including tool name, metadata (title, description, annotations), input schema, and inline handler function.
    server.registerTool(
      "tmux_rename_session",
      {
        title: "Rename tmux Session",
        description: `Rename an existing tmux session.
    
    Args:
      - old_name (string, required): Current session name
      - new_name (string, required): New session name`,
        inputSchema: z
          .object({
            old_name: z.string().min(1).describe("Current session name"),
            new_name: z.string().min(1).describe("New session name"),
          })
          .strict(),
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ old_name, new_name }) => {
        try {
          await runTmux(`rename-session -t "${old_name}" "${new_name}"`);
    
          return {
            content: [{ type: "text", text: `Session renamed from '${old_name}' to '${new_name}'.` }],
            structuredContent: { success: true, old_name, new_name },
          };
        } 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 provide readOnlyHint=false (mutation), idempotentHint=true (safe to retry), and destructiveHint=false (non-destructive). The description adds minimal context beyond this, confirming it renames an existing session but not detailing side effects like session continuity or error conditions. It doesn't contradict annotations, so baseline 3 is appropriate given annotations cover core behavioral traits.

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 clear Args section. It's appropriately sized with no redundant information, though the Args section slightly duplicates schema content. Every sentence serves a purpose, making it efficient but not perfectly minimal.

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 (mutation with idempotency), annotations provide good coverage, and schema coverage is 100%, but there's no output schema. The description lacks details on return values or error handling, which could be helpful. It's adequate but has gaps in completeness for a mutation tool without output schema.

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 both parameters (old_name, new_name) fully documented in the schema. The description repeats this information in the Args section but doesn't add meaningful semantics beyond what the schema provides, such as naming constraints or examples. Baseline 3 is correct as the schema handles parameter documentation adequately.

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') and target resource ('an existing tmux session'), distinguishing it from sibling tools like tmux_create_session (creates new) and tmux_rename_window (renames windows instead of sessions). 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by stating 'Rename an existing tmux session,' which suggests it should be used when a session already exists, but it doesn't explicitly contrast with alternatives like tmux_create_session or provide guidance on when not to use it. No explicit when/when-not statements or named alternatives are provided.

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