# list_windows

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

> List tmux windows (terminal tabs) in a session, or across the server.

tool MCPstable

MCP is in development

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

* **list_windows**( [filters](https://libtmux.org/en/py/stable/mcp/tools/list_windows/#mcp.tool.list_windows.input%2Fproperties%2Ffilters)?: [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/list_windows/#mcp.tool.list_windows.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/list_windows/#mcp.tool.list_windows.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/list_windows/#mcp.tool.list_windows.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)"), )

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

  List tmux windows (terminal tabs) in a session, or across the server.

  Use for tmux windows — ‘current window’, ‘this tab’ (when terminal- contextual) — not browser tabs or desktop windows. Only searches window metadata (name, index, layout); to search the actual visible terminal text, use [search_panes](https://libtmux.org/en/py/stable/mcp/tools/search_panes/).

  * MCP request method

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

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

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

    Django-style filters as a dict (e.g. `{"window_name__contains": "dev"}`) or as a JSON string. Some MCP clients require the string form.

  * **[`session_id`](https://libtmux.org/en/py/stable/mcp/tools/list_windows/#mcp.tool.list_windows.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/list_windows/#mcp.tool.list_windows.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. If omitted along with session_id, returns windows from all sessions.

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/list_windows/#mcp.tool.list_windows.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.

  No other arguments are accepted.

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

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

  * **[`result`](https://libtmux.org/en/py/stable/mcp/tools/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult)** ([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)")>)

    * **[Items](https://libtmux.org/en/py/stable/mcp/tools/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      Serialized tmux window.

      * **[`active_pane_id`](https://libtmux.org/en/py/stable/mcp/tools/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.output%2Fproperties%2Fresult%2Fitems%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/list_windows/#mcp.tool.list_windows.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/list_windows/#mcp.tool.list_windows.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "filters": {
        "anyOf": [
          {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Django-style filters as a dict (e.g. ``{\"window_name__contains\": \"dev\"}``)\nor as a JSON string. Some MCP clients require the string form."
      },
      "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. If omitted along with session_id,\nreturns windows from all sessions."
      },
      "socket_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "tmux socket name. Defaults to LIBTMUX_SOCKET env var."
      }
    },
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "properties": {
      "result": {
        "items": {
          "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"
        },
        "type": "array"
      }
    },
    "required": [
      "result"
    ],
    "type": "object",
    "x-fastmcp-wrap-result": true
  }
  ```
