# create_window

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

> Create a new window in a tmux session.

tool MCPstable

MCP is in development

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

* **create_window**( [attach](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fattach)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [direction](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fdirection)?: "before" | "after" | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [environment](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fenvironment)?: [Record](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")\<string, [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)")> | [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](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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)"), [start_directory](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fstart_directory)?: [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)"), [suppress_persistent_history](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fsuppress_persistent_history)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [window_name](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fwindow_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)"), )

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

  Create a new window in a tmux session.

  Creates a window with one pane. Use [split_window](https://libtmux.org/en/py/stable/mcp/tools/split_window/) to add more panes afterward.

  * MCP request method

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

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

  * **[`attach`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fattach)**? = `false` ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Whether to make the new window active.

  * **[`direction`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fdirection)**? = `null` ("before" | "after" | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Window placement direction.

  * **[`environment`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fenvironment)**? = `null` ([Record](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")\<string, [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)")> | [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)"))

    Per-process environment as a mapping or JSON object string. Values do not modify the tmux session environment. Each item becomes a tmux `-e` launch option. Values may be visible to host process inspection in the tmux client argv during launch and in the child environment afterward; MCP audit redaction does not hide either surface. Pass credential references, not literal credentials.

  * **[`session_id`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.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 (e.g. ‘$1’) to look up.

  * **[`session_name`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.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 to look up.

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.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. Defaults to LIBTMUX_SOCKET env var.

  * **[`start_directory`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fstart_directory)**? = `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)"))

    Existing directory to start in. `~` expands; a relative path resolves against the MCP server process’s directory.

  * **[`suppress_persistent_history`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%2Fproperties%2Fsuppress_persistent_history)**? = `false` ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Whether to suppress persistent history for the spawned shell. Defaults to False for MCP and direct Python calls. This per-call option does not inherit LIBTMUX_SUPPRESS_HISTORY. Startup files may override these controls.

  * **[`window_name`](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.input%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)"))

    Name for the new window.

  No other arguments are accepted.

  ## Result[#](https://libtmux.org/en/py/stable/mcp/tools/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.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/create_window/#mcp.tool.create_window.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "attach": {
        "default": false,
        "description": "Whether to make the new window active.",
        "type": "boolean"
      },
      "direction": {
        "anyOf": [
          {
            "enum": [
              "before",
              "after"
            ],
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Window placement direction."
      },
      "environment": {
        "anyOf": [
          {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Per-process environment as a mapping or JSON object string. Values do\nnot modify the tmux session environment. Each item becomes a tmux\n``-e`` launch option. Values may be visible to host process inspection\nin the tmux client argv during launch and in the child environment\nafterward; MCP audit redaction does not hide either surface. Pass\ncredential references, not literal credentials."
      },
      "session_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Session ID (e.g. '$1') to look up."
      },
      "session_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Session name to look up."
      },
      "socket_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "tmux socket name. Defaults to LIBTMUX_SOCKET env var."
      },
      "start_directory": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Existing directory to start in. ``~`` expands; a relative path\nresolves against the MCP server process's directory."
      },
      "suppress_persistent_history": {
        "default": false,
        "description": "Whether to suppress persistent history for the spawned shell. Defaults\nto False for MCP and direct Python calls. This per-call option does not\ninherit LIBTMUX_SUPPRESS_HISTORY. Startup files may override these\ncontrols.",
        "type": "boolean"
      },
      "window_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Name for the new window."
      }
    },
    "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"
  }
  ```
