create_window
- create_window( attach?: boolean, direction?: "before" | "after" | null, environment?: Record<string, string> | string | null, session_id?: string | null, session_name?: string | null, socket_name?: string | null, start_directory?: string | null, suppress_persistent_history?: boolean, window_name?: string | null, )
-
Create a new window in a tmux session.
Creates a window with one pane. Use split_window to add more panes afterward.
- MCP request method
tools/callSendcreate_windowas the tool name, with the arguments below.- Wraps
libtmux.Session.new_windowThe library call this tool makes:src/libtmux_mcp/tools/session_tools.py:190.
Arguments
-
Whether to make the new window active.
-
direction? =null("before" | "after" | null)Window placement direction.
-
environment? =null(Record<string, string> | string | null)Per-process environment as a mapping or JSON object string. Values do not modify the tmux session environment. Each item becomes a tmux
-elaunch 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? =null(string | null)Session ID (e.g. ‘$1’) to look up.
-
session_name? =null(string | null)Session name to look up.
-
socket_name? =null(string | null)tmux socket name. Defaults to LIBTMUX_SOCKET env var.
-
start_directory? =null(string | null)Existing directory to start in.
~expands; a relative path resolves against the MCP server process’s directory. -
suppress_persistent_history? =false(boolean)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? =null(string | null)Name for the new window.
No other arguments are accepted.
Result
Returns object
-
active_pane_id? =null(string | null)Pane id (
%N) of the window’s active pane. -
Number of panes
-
session_id? =null(string | null)Parent session ID
-
session_name? =null(string | null)Parent session name
-
window_active? =null(string | null)Active flag (‘1’ or ‘0’)
-
window_height? =null(string | null)Height in rows
-
Window ID (e.g. ‘@1’)
-
window_index? =null(string | null)Window index
-
window_layout? =null(string | null)Layout string
-
window_name? =null(string | null)Window name
-
window_width? =null(string | null)Width in columns
Annotations
Advertised by the server
destructiveHinttrueidempotentHintfalseopenWorldHinttruereadOnlyHintfalse
Capability
- Toolset
- Execute Start or drive pane processes, or store state that can control later execution.
Every Python tool advertises the same annotations, so a host that approves by annotation cannot tell tools apart. The capability row is what tells them apart.
Protocol data
Use the complete advertised contract for validation and client integration.
Input schema
{"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
{"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"}