# show_hook

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

> Look up a specific tmux hook by name.

tool MCPstable

MCP is in development

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

* **show_hook**( [global\_](https://libtmux.org/en/py/stable/mcp/tools/show_hook/#mcp.tool.show_hook.input%2Fproperties%2Fglobal_)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [hook_name](https://libtmux.org/en/py/stable/mcp/tools/show_hook/#mcp.tool.show_hook.input%2Fproperties%2Fhook_name): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [scope](https://libtmux.org/en/py/stable/mcp/tools/show_hook/#mcp.tool.show_hook.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_hook/#mcp.tool.show_hook.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_hook/#mcp.tool.show_hook.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#L248)][¶](https://libtmux.org/en/py/stable/mcp/tools/show_hook/#mcp.tool.show_hook)

  Look up a specific tmux hook by name.

  Returns a [`HookListResult`](https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-models-hooklistresult/) with zero or more [`HookEntry`](https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-models-hookentry/) rows — zero if the hook is unset, one if it is a scalar hook, and multiple if it is an array hook with sparse indices.

  * MCP request method

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

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

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

    [`show_hooks`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/).

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

    Hook to look up (e.g. [`"pane-exited"`](https://libtmux.org/en/tmux/latest/catalog/hooks/pane-exited/)).

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

    [`show_hooks`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/).

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/show_hook/#mcp.tool.show_hook.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)"))

    [`show_hooks`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/).

  * **[`target`](https://libtmux.org/en/py/stable/mcp/tools/show_hook/#mcp.tool.show_hook.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)"))

    [`show_hooks`](https://libtmux.org/en/py/stable/mcp/tools/show_hooks/).

  No other arguments are accepted.

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

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "global_": {
        "default": false,
        "description": ":func:`~libtmux_mcp.tools.hook_tools.show_hooks`.",
        "type": "boolean"
      },
      "hook_name": {
        "description": "Hook to look up (e.g. ``\"pane-exited\"``).",
        "type": "string"
      },
      "scope": {
        "anyOf": [
          {
            "enum": [
              "server",
              "session",
              "window",
              "pane"
            ],
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": ":func:`~libtmux_mcp.tools.hook_tools.show_hooks`."
      },
      "socket_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": ":func:`~libtmux_mcp.tools.hook_tools.show_hooks`."
      },
      "target": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": ":func:`~libtmux_mcp.tools.hook_tools.show_hooks`."
      }
    },
    "required": [
      "hook_name"
    ],
    "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"
  }
  ```
