# select_layout

Source: https://libtmux.org/en/py/stable/mcp/tools/select_layout/

> Set the layout of a tmux window.

tool MCPstable

MCP is in development

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

* **select_layout**( [layout](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Flayout): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [session_id](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fsession_id)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [session_name](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fsession_name)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [socket_name](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fsocket_name)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [window_id](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fwindow_id)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [window_index](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fwindow_index)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), )

  tool \[[source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/window_tools.py#L527)][¶](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout)

  Set the layout of a tmux window.

  Choose from: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled. Rearranges all panes in the window.

  * MCP request method

    `tools/call` Send `select_layout` as the tool name, with the arguments below.

  ## Arguments[#](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.parameters)

  * **[`layout`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Flayout)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Layout name or custom layout string. Built-in layouts: ‘even-horizontal’, ‘even-vertical’, ‘main-horizontal’, ‘main-horizontal-mirrored’, ‘main-vertical’, ‘main-vertical-mirrored’, ‘tiled’.

  * **[`session_id`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fsession_id)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Session ID.

  * **[`session_name`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fsession_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Session name.

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fsocket_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    tmux socket name.

  * **[`window_id`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fwindow_id)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Window ID (e.g. ‘@1’).

  * **[`window_index`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.input%2Fproperties%2Fwindow_index)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Window index within the session.

  No other arguments are accepted.

  ## Result[#](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.result)

  Returns [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")

  * **[`active_pane_id`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Factive_pane_id)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Pane id (`%N`) of the window’s active pane.

  * **[`pane_count`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fpane_count)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Number of panes

  * **[`session_id`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fsession_id)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Parent session ID

  * **[`session_name`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fsession_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Parent session name

  * **[`window_active`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fwindow_active)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Active flag (‘1’ or ‘0’)

  * **[`window_height`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fwindow_height)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Height in rows

  * **[`window_id`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fwindow_id)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Window ID (e.g. ‘@1’)

  * **[`window_index`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fwindow_index)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Window index

  * **[`window_layout`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fwindow_layout)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Layout string

  * **[`window_name`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fwindow_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Window name

  * **[`window_width`](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.output%2Fproperties%2Fwindow_width)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Width in columns

  ## Annotations[#](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.annotations)

  * [`destructiveHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#openWorldHint)

    `true`

  * [`readOnlyHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/py/stable/mcp/tools/select_layout/#mcp.tool.select_layout.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "layout": {
        "description": "Layout name or custom layout string. Built-in layouts:\n'even-horizontal', 'even-vertical', 'main-horizontal',\n'main-horizontal-mirrored', 'main-vertical',\n'main-vertical-mirrored', 'tiled'.",
        "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": [
      "layout"
    ],
    "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"
  }
  ```
