# rename_window

Source: https://libtmux.org/en/py/latest/mcp/tools/rename_window/

> Rename a tmux window.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Rename a tmux window.

Use when a window’s purpose has changed. Existing window_id references remain valid after renaming.

[All Python tools](https://libtmux.org/en/py/latest/mcp/tools/) · [JSON](https://libtmux.org/en/py/latest/mcp/tools/rename_window.json) · [Source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/window_tools.py#L517)

## Arguments

* `new_name` required · string

  The new name for the window.

* `session_id` optional

  Session ID.

  Default: `null`.

* `session_name` optional

  Session name.

  Default: `null`.

* `socket_name` optional

  tmux socket name.

  Default: `null`.

* `window_id` optional

  Window ID (e.g. '@1').

  Default: `null`.

* `window_index` optional

  Window index within the session.

  Default: `null`.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.

Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "new_name": {
      "description": "The new name for the window.",
      "type": "string"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Session ID."
    },
    "session_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Session name."
    },
    "socket_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "tmux socket name."
    },
    "window_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Window ID (e.g. '@1')."
    },
    "window_index": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Window index within the session."
    }
  },
  "required": [
    "new_name"
  ],
  "type": "object"
}
```

Output schema

```json
{
  "description": "Serialized tmux window.",
  "properties": {
    "active_pane_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Pane id (``%N``) of the window's active pane."
    },
    "pane_count": {
      "description": "Number of panes",
      "type": "integer"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Parent session ID"
    },
    "session_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Parent session name"
    },
    "window_active": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Active flag ('1' or '0')"
    },
    "window_height": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Height in rows"
    },
    "window_id": {
      "description": "Window ID (e.g. '@1')",
      "type": "string"
    },
    "window_index": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Window index"
    },
    "window_layout": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Layout string"
    },
    "window_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Window name"
    },
    "window_width": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Width in columns"
    }
  },
  "required": [
    "window_id",
    "pane_count"
  ],
  "type": "object"
}
```

Tool annotations

```json
{
  "destructiveHint": true,
  "idempotentHint": false,
  "openWorldHint": true,
  "readOnlyHint": false
}
```
