# show_hooks

Source: https://libtmux.org/en/py/stable/mcp/tools/show_hooks/

> List configured tmux hooks at the given scope.

tool MCPstable

MCP is in development

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

* **show_hooks**( [global\_](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Fglobal_)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [scope](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Fscope)?: "server" | "session" | "window" | "pane" | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [socket_name](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Fsocket_name)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [target](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Ftarget)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), )

  tool \[[source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/hook_tools.py#L243)][¶](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks)

  List configured tmux hooks at the given scope.

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

  * MCP request method

    `tools/call` Send `show_hooks` as the tool name, with the arguments below.

  ## Arguments[#](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.parameters)

  * **[`global_`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Fglobal_)**? = `false` ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

    Pass `-g` to query global hooks. Default False.

  * **[`scope`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Fscope)**? = `null` ("server" | "session" | "window" | "pane" | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

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

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Fsocket_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    tmux socket name.

  * **[`target`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.input%2Fproperties%2Ftarget)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    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[#](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.result)

  Returns [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")

  * **[`entries`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.output%2Fproperties%2Fentries)**? ([Array](https://json-schema.org/understanding-json-schema/reference/array "array (JSON Schema)")<[object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")>)

    * **[Items](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.output%2Fproperties%2Fentries%2Fitems)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      One entry in a tmux hook array.

      Hooks like [`session-renamed`](https://libtmux.org/en/tmux/latest/catalog/hooks/session-renamed/) are arrays — they can have multiple commands registered at sparse indices. [`HookEntry`](https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-models-hookentry/) flattens one index+command pair into a serialisable row.

      * **[`command`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.output%2Fproperties%2Fentries%2Fitems%2Fproperties%2Fcommand)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

        tmux command string registered at that index.

      * **[`hook_name`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.output%2Fproperties%2Fentries%2Fitems%2Fproperties%2Fhook_name)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

        Hook name (e.g. ‘pane-exited’).

      * **[`index`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.output%2Fproperties%2Fentries%2Fitems%2Fproperties%2Findex)**? = `null` ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

        Array index for array-style hooks (e.g. session-renamed\[3]). `None` for scalar hooks.

  ## Annotations[#](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.annotations)

  * [`destructiveHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#openWorldHint)

    `true`

  * [`readOnlyHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/#mcp.tool.show_hooks.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "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

  ```json
  {
    "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"
  }
  ```
