Skip to content

Commit b793fec

Browse files
committed
mcp(fix[docs]): Use %1 not %%1 for pane ID examples in docstrings
why: `%%1` in plain Python strings is literally two percent signs, not an escaped `%1`. These docstrings become MCP tool descriptions shown to AI agents, which would send `%%1` as the pane_id and fail lookups since tmux pane IDs use a single `%` prefix (`%0`, `%1`, etc.). what: - Replace all 11 instances of `%%1` with `%1` across server.py, _utils.py, pane_tools.py, and hierarchy.py
1 parent 1c1a6fa commit b793fec

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/libtmux/mcp/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _resolve_pane(
228228
server : Server
229229
The tmux server.
230230
pane_id : str, optional
231-
Pane ID (e.g. '%%1'). Globally unique within a server.
231+
Pane ID (e.g. '%1'). Globally unique within a server.
232232
session_name : str, optional
233233
Session name for hierarchical resolution.
234234
session_id : str, optional

src/libtmux/mcp/resources/hierarchy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def get_pane(pane_id: str) -> str:
117117
Parameters
118118
----------
119119
pane_id : str
120-
The pane ID (e.g. '%%1').
120+
The pane ID (e.g. '%1').
121121
122122
Returns
123123
-------
@@ -139,7 +139,7 @@ def get_pane_content(pane_id: str) -> str:
139139
Parameters
140140
----------
141141
pane_id : str
142-
The pane ID (e.g. '%%1').
142+
The pane ID (e.g. '%1').
143143
144144
Returns
145145
-------

src/libtmux/mcp/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
name="libtmux",
1212
instructions=(
1313
"libtmux MCP server for programmatic tmux control. "
14-
"Use pane_id (e.g. '%%1') as the preferred targeting method - "
14+
"Use pane_id (e.g. '%1') as the preferred targeting method - "
1515
"it is globally unique within a tmux server. "
1616
"Use send_keys to execute commands and capture_pane to read output. "
1717
"All tools accept an optional socket_name parameter for multi-server support."

src/libtmux/mcp/tools/pane_tools.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def send_keys(
3434
keys : str
3535
The keys or text to send.
3636
pane_id : str, optional
37-
Pane ID (e.g. '%%1').
37+
Pane ID (e.g. '%1').
3838
session_name : str, optional
3939
Session name for pane resolution.
4040
window_id : str, optional
@@ -83,7 +83,7 @@ def capture_pane(
8383
Parameters
8484
----------
8585
pane_id : str, optional
86-
Pane ID (e.g. '%%1').
86+
Pane ID (e.g. '%1').
8787
session_name : str, optional
8888
Session name for pane resolution.
8989
window_id : str, optional
@@ -126,7 +126,7 @@ def resize_pane(
126126
Parameters
127127
----------
128128
pane_id : str, optional
129-
Pane ID (e.g. '%%1').
129+
Pane ID (e.g. '%1').
130130
session_name : str, optional
131131
Session name for pane resolution.
132132
window_id : str, optional
@@ -183,7 +183,7 @@ def kill_pane(
183183
Parameters
184184
----------
185185
pane_id : str, optional
186-
Pane ID (e.g. '%%1').
186+
Pane ID (e.g. '%1').
187187
session_name : str, optional
188188
Session name for pane resolution.
189189
window_id : str, optional
@@ -223,7 +223,7 @@ def set_pane_title(
223223
title : str
224224
The new pane title.
225225
pane_id : str, optional
226-
Pane ID (e.g. '%%1').
226+
Pane ID (e.g. '%1').
227227
session_name : str, optional
228228
Session name for pane resolution.
229229
window_id : str, optional
@@ -259,7 +259,7 @@ def get_pane_info(
259259
Parameters
260260
----------
261261
pane_id : str, optional
262-
Pane ID (e.g. '%%1').
262+
Pane ID (e.g. '%1').
263263
session_name : str, optional
264264
Session name for pane resolution.
265265
window_id : str, optional
@@ -294,7 +294,7 @@ def clear_pane(
294294
Parameters
295295
----------
296296
pane_id : str, optional
297-
Pane ID (e.g. '%%1').
297+
Pane ID (e.g. '%1').
298298
session_name : str, optional
299299
Session name for pane resolution.
300300
window_id : str, optional

0 commit comments

Comments
 (0)