# move_window

Source: https://libtmux.org/en/ts/latest/mcp/tools/move_window/

> Change tmux state; no client-supplied executable input. Move a window to another index, or into another session.

tool MCPlatest

MCP concept example

A working example of the core library. It can change without notice.

[What concept means](https://libtmux.org/en/meta/support/#concept-and-alpha)

* **move_window**( [index](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2Findex)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [session](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2Fsession)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [sourceIndex](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2FsourceIndex)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [sourceSession](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2FsourceSession)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [windowId](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2FwindowId): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), )

  tool \[[source](https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/mcp/src/tools/layout.ts#L268)][¶](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window)

  Change tmux state; no client-supplied executable input. Move a window to another index, or into another session.

  * MCP request method

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

  ## Arguments[#](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.parameters)

  * **[`index`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2Findex)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Destination index. Defaults to the next free one.

    * minimum

      `0`

    * maximum

      `9007199254740991`

  * **[`session`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2Fsession)**? ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Destination session id or name.

  * **[`sourceIndex`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2FsourceIndex)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Source window index. Required when the session has several placements of the id.

    * minimum

      `0`

    * maximum

      `9007199254740991`

  * **[`sourceSession`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2FsourceSession)**? ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Source session id or name. Required when the id has several placements.

  * **[`windowId`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.input%2Fproperties%2FwindowId)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Stable window id, e.g. @1.

    * pattern

      `"^@\\d+$"`

  ## Result[#](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.result)

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

  * **[`window`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

    * **[`id`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fid)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

      Stable window id, e.g. @1.

      * pattern

        `"^@\\d+$"`

    * **[`layout`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Flayout)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

      tmux’s layout string; feed it back only when metadataComplete is true.

    * **[`metadataComplete`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2FmetadataComplete)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

      Whether every projected metadata string is complete.

    * **[`name`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fname)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    * **[`omittedMetadataBytes`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2FomittedMetadataBytes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      UTF-8 bytes omitted from projected metadata strings.

      * minimum

        `0`

      * maximum

        `9007199254740991`

    * **[`omittedPlacements`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2FomittedPlacements)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      Later placements omitted.

      * minimum

        `0`

      * maximum

        `9007199254740991`

    * **[`panes`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fpanes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

    * **[`placements`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fplacements)** ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")>)

      Retained sessions and indexes where this window is linked.

      * **[Items](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fplacements%2Fitems)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

        * **[`active`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fplacements%2Fitems%2Fproperties%2Factive)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

          Whether this placement is current in its session.

        * **[`index`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fplacements%2Fitems%2Fproperties%2Findex)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

          The window index in this session.

          * minimum

            `-9007199254740991`

          * maximum

            `9007199254740991`

        * **[`sessionId`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fplacements%2Fitems%2Fproperties%2FsessionId)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          Stable session id, e.g. $1.

          * pattern

            `"^\\$\\d+$"`

        * **[`sessionName`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fplacements%2Fitems%2Fproperties%2FsessionName)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

        No other properties are accepted.

    * **[`placementsComplete`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2FplacementsComplete)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

      Whether placements contains every placement.

    * **[`zoomed`](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.output%2Fproperties%2Fwindow%2Fproperties%2Fzoomed)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    No other properties are accepted.

  No other properties are accepted.

  ## Annotations[#](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.annotations)

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

    `true`

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

    `false`

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

    `true`

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

    `false`

  ## Protocol data[#](https://libtmux.org/en/ts/latest/mcp/tools/move_window/#mcp.tool.move_window.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "index": {
        "description": "Destination index. Defaults to the next free one.",
        "maximum": 9007199254740991,
        "minimum": 0,
        "type": "integer"
      },
      "session": {
        "description": "Destination session id or name.",
        "type": "string"
      },
      "sourceIndex": {
        "description": "Source window index. Required when the session has several placements of the id.",
        "maximum": 9007199254740991,
        "minimum": 0,
        "type": "integer"
      },
      "sourceSession": {
        "description": "Source session id or name. Required when the id has several placements.",
        "type": "string"
      },
      "windowId": {
        "description": "Stable window id, e.g. @1.",
        "pattern": "^@\\d+$",
        "type": "string"
      }
    },
    "required": [
      "windowId"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "properties": {
      "window": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "Stable window id, e.g. @1.",
            "pattern": "^@\\d+$",
            "type": "string"
          },
          "layout": {
            "description": "tmux's layout string; feed it back only when metadataComplete is true.",
            "type": "string"
          },
          "metadataComplete": {
            "description": "Whether every projected metadata string is complete.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "omittedMetadataBytes": {
            "description": "UTF-8 bytes omitted from projected metadata strings.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "omittedPlacements": {
            "description": "Later placements omitted.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "panes": {
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "placements": {
            "description": "Retained sessions and indexes where this window is linked.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "active": {
                  "description": "Whether this placement is current in its session.",
                  "type": "boolean"
                },
                "index": {
                  "description": "The window index in this session.",
                  "maximum": 9007199254740991,
                  "minimum": -9007199254740991,
                  "type": "integer"
                },
                "sessionId": {
                  "description": "Stable session id, e.g. $1.",
                  "pattern": "^\\$\\d+$",
                  "type": "string"
                },
                "sessionName": {
                  "type": "string"
                }
              },
              "required": [
                "index",
                "sessionId",
                "sessionName",
                "active"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "placementsComplete": {
            "description": "Whether placements contains every placement.",
            "type": "boolean"
          },
          "zoomed": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "layout",
          "metadataComplete",
          "name",
          "omittedMetadataBytes",
          "panes",
          "omittedPlacements",
          "placements",
          "placementsComplete",
          "zoomed"
        ],
        "type": "object"
      }
    },
    "required": [
      "window"
    ],
    "type": "object"
  }
  ```
