Skip to content

Commit 489d632

Browse files
committed
mcp(docs[tools/sessions]): note SessionInfo.active_pane_id surfaces the new pane id
The ``create_session`` response gained an ``active_pane_id`` field earlier in this branch (commit ``3f092bb``), but the docs still showed the pre-change response shape — readers landing on ``sessions.md`` had no signal that this field exists or what they'd do with it. Updates the example response to include the field, then adds a brief tip explaining the workflow win: callers can target subsequent ``send_keys`` / ``split_window`` / ``capture_pane`` calls against ``active_pane_id`` directly without a follow-up ``list_panes`` round-trip. Saves one MCP call in the most common "create a session, then act on it" workflow that prompts like ``build_dev_workspace`` already exploit. The full field surface is auto-rendered in ``docs/reference/api/models.md`` via the ``fastmcp_model_classes`` registration — this commit just adds the narrative discoverability that explains why the field exists.
1 parent ba26d68 commit 489d632

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

docs/tools/sessions.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,21 @@ Response:
177177
"session_name": "dev",
178178
"window_count": 1,
179179
"session_attached": "0",
180-
"session_created": "1774521872"
180+
"session_created": "1774521872",
181+
"active_pane_id": "%0"
181182
}
182183
```
183184

185+
```{tip}
186+
The returned ``active_pane_id`` is the pane ID (``%N``) of the
187+
session's initial pane. It's guaranteed non-``None`` immediately
188+
after ``create_session`` (libtmux always creates the session with
189+
one initial pane), so you can target subsequent ``send_keys`` /
190+
``split_window`` / ``capture_pane`` calls directly without a
191+
follow-up {tooliconl}`list-panes` round-trip — saving an MCP call
192+
in the most common "new session, then act on it" workflow.
193+
```
194+
184195
```{fastmcp-tool-input} server_tools.create_session
185196
```
186197

0 commit comments

Comments
 (0)