# show_hooks

Source: https://libtmux.org/en/rs/latest/mcp/tools/show_hooks/

> List the hooks tmux runs when something happens on the server, such as a pane exiting. This tool does not set hooks. Hooks set through another path remain in their server or session until unset; configuration files persist them across server restarts. Reach for this when tmux does something no tool here asked for. Read configured tmux commands; accepts no client-supplied executable input. Returned values may contain executable configuration.

MCP is in development

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

List the hooks tmux runs when something happens on the server, such as a pane exiting. This tool does not set hooks. Hooks set through another path remain in their server or session until unset; configuration files persist them across server restarts. Reach for this when tmux does something no tool here asked for. Read configured tmux commands; accepts no client-supplied executable input. Returned values may contain executable configuration.

[All Rust tools](https://libtmux.org/en/rs/latest/mcp/tools/) · [JSON](https://libtmux.org/en/rs/latest/mcp/tools/show_hooks.json) · [Source](https://github.com/libtmux/libtmux-rs/blob/2cef1aa642182dd1970c3688feb6a568ff666e64/crates/tmux-mcp/src/tools/inspect.rs#L560)

## Arguments

* `session` optional · string | null

  The session whose hooks to read, by \`$\`-prefixed id or name. Omit for the server's own.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.

Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "session": {
      "description": "The session whose hooks to read, by `$`-prefixed id or name. Omit for\nthe server's own.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "type": "object"
}
```

Output schema

```json
{
  "$defs": {
    "Hook": {
      "description": "One tmux hook.",
      "properties": {
        "command": {
          "description": "The command tmux runs.",
          "type": "string"
        },
        "index": {
          "description": "Its index, when the hook is an array.",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "name": {
          "description": "The hook name, such as `pane-exited`.",
          "type": "string"
        }
      },
      "required": [
        "name",
        "command"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "hooks": {
      "description": "The hooks, in tmux's own order.",
      "items": {
        "$ref": "#/$defs/Hook"
      },
      "type": "array"
    }
  },
  "required": [
    "hooks"
  ],
  "type": "object"
}
```

Tool annotations

```json
{
  "destructiveHint": false,
  "idempotentHint": true,
  "openWorldHint": false,
  "readOnlyHint": true,
  "title": "Show tmux Hooks"
}
```
