# libtmux_mcp.tools.session_tools.list_windows

- **Module:** libtmux_mcp.tools.session_tools
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/session_tools.py#L36
- **Page:** https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-tools-session_tools-list_windows/

```
libtmux_mcp.tools.session_tools.list_windows(
    session_name: str | None = None,
    session_id: str | None = None,
    socket_name: str | None = None,
    filters: dict[str, str] | str | None = None,
) -> list[WindowInfo]
```

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.

## Parameters

- `session_name` (`str | None`): Session name to look up. If omitted along with session_id,
returns windows from all sessions.
- `session_id` (`str | None`): Session ID (e.g. '$1') to look up.
- `socket_name` (`str | None`): tmux socket name. Defaults to LIBTMUX_SOCKET env var.
- `filters` (`dict[str, str] | str | None`): Django-style filters as a dict (e.g. ``{"window_name__contains": "dev"}``)
or as a JSON string. Some MCP clients require the string form.

## Returns

list[WindowInfo]
    List of serialized window objects.
