MCPpre-alphaTools

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

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

tool MCP

show_hooks

show_hooks( global_?: boolean, scope?: "server" | "session" | "window" | "pane" | null, socket_name?: string | null, target?: string | null, )

List configured tmux hooks at the given scope.

scope="server" enumerates hooks installed via tmux set-hook -g .... tmux splits those globals across two options trees by hook category: session-level hooks (session-closed, client-*, etc.) live in the global-session tree enumerated by show-hooks -g, while pane/window-level hooks (pane-focus-in, window-resized, etc.) live in the global-window tree enumerated by show-hooks -gw. This tool consults both trees and merges the results so the enumeration matches what a name-targeted show_hook call would return.

MCP request method
tools/call Send show_hooks as the tool name, with the arguments below.
Wraps
libtmux.hooks.HooksMixin.show_hooksThe library call this tool makes: src/libtmux_mcp/tools/hook_tools.py:178.

Arguments

  • global_? = false (boolean)

    Pass -g to query global hooks. Default False.

  • scope? = null ("server" | "session" | "window" | "pane" | null)

    Hook scope (server/session/window/pane). Defaults to the calling object’s scope when a target is given.

  • socket_name? = null (string | null)

    tmux socket name.

  • target? = null (string | null)

    Target identifier. For session scope: session name. For window scope: window ID. For pane scope: pane ID. Requires scope.

No other arguments are accepted.

Result

Returns object

Annotations

Advertised by the server

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false

Capability

Toolset
Inspect Request tmux state and terminal output.

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": {
"global_": {
"default": false,
"description": "Pass ``-g`` to query global hooks. Default False.",
"type": "boolean"
},
"scope": {
"anyOf": [
{
"enum": [
"server",
"session",
"window",
"pane"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Hook scope (server/session/window/pane). Defaults to the\ncalling object's scope when a ``target`` is given."
},
"socket_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "tmux socket name."
},
"target": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Target identifier. For session scope: session name. For window\nscope: window ID. For pane scope: pane ID. Requires ``scope``."
}
},
"type": "object"
}
Output schema
{
"description": "Structured result for hook introspection.\n\nReturned by :func:`~libtmux_mcp.tools.hook_tools.show_hooks` and\n:func:`~libtmux_mcp.tools.hook_tools.show_hook`.\nFlat list of :class:`~libtmux_mcp.models.HookEntry` instances so\nMCP clients can iterate without caring whether the underlying tmux\nhook is scalar or array-shaped.",
"properties": {
"entries": {
"items": {
"description": "One entry in a tmux hook array.\n\nHooks like ``session-renamed`` are arrays — they can have multiple\ncommands registered at sparse indices.\n:class:`~libtmux_mcp.models.HookEntry` flattens one index+command\npair into a serialisable row.",
"properties": {
"command": {
"description": "tmux command string registered at that index.",
"type": "string"
},
"hook_name": {
"description": "Hook name (e.g. 'pane-exited').",
"type": "string"
},
"index": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Array index for array-style hooks (e.g. session-renamed[3]). ``None`` for scalar hooks."
}
},
"required": [
"hook_name",
"command"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
Esc
Search in

Type to search.

Reference previewOpen reference