# tmux_run

Source: https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/

> Run an authored POSIX script in an explicitly enrolled idle, empty zsh 5.9 editor. Opt-in; no terminal injection. Exact queue authorization binds the existing shell generation; execution may follow a later pane replacement without retargeting it. Inherits cwd/exported environment, closed stdin, separate bounded UTF-8/base64 outputs. Defaults: 65536 bytes per output, 65536 script bytes; overflow refuses completion. Reports native exit/signal only from the helper; cancellation never proves descendants stopped.

tool MCPv0.1.0.alpha.3

MCP concept example

A working example of the core library. It can change without notice.

[What concept means](https://libtmux.org/en/meta/support/#concept-and-alpha)

* **tmux_run**( [script](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Fscript): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [stderr_limit](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Fstderr_limit)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [stdout_limit](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Fstdout_limit)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [target](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Ftarget): [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"), )

  tool \[[source](https://github.com/libtmux/libtmux-ruby/blob/d8ce4bbee0ca7748a81929f81f7d8d07f8c51267/gems/libtmux-mcp/lib/libtmux/mcp/catalog.rb#L238)][¶](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run)

  Run an authored POSIX script in an explicitly enrolled idle, empty zsh 5.9 editor. Opt-in; no terminal injection. Exact queue authorization binds the existing shell generation; execution may follow a later pane replacement without retargeting it. Inherits cwd/exported environment, closed stdin, separate bounded UTF-8/base64 outputs. Defaults: 65536 bytes per output, 65536 script bytes; overflow refuses completion. Reports native exit/signal only from the helper; cancellation never proves descendants stopped.

  * MCP request method

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

  * Tool selection

    Opt in with `--enable-tool tmux_run`.

  ## Arguments[#](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.parameters)

  * **[`script`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Fscript)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    * maxLength

      `65536`

    * pattern

      `"^[^\\u0000]*$"`

  * **[`stderr_limit`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Fstderr_limit)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    * minimum

      `0`

    * maximum

      `262144`

  * **[`stdout_limit`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Fstdout_limit)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    * minimum

      `0`

    * maximum

      `262144`

  * **[`target`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Ftarget)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

    Matches exactly one variant.

    * **[Variant 1](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Ftarget%2FoneOf%2F0)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      * **[`generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Ftarget%2FoneOf%2F0%2Fproperties%2Fgeneration)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

        * minLength

          `1`

        * maxLength

          `128`

      * **[`id`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Ftarget%2FoneOf%2F0%2Fproperties%2Fid)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

        * maxLength

          `32`

        * pattern

          `"^%[0-9]+$"`

      * **[`kind`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.input%2Fproperties%2Ftarget%2FoneOf%2F0%2Fproperties%2Fkind)** ("pane")

      No other properties are accepted.

  No other arguments are accepted.

  ## Result[#](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.result)

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

  Matches exactly one variant.

  * **[Variant 1](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

    * **[`data`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      * **[`authorization`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

        * **[`enrollment_generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization%2Fproperties%2Fenrollment_generation)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * maxLength

            `32`

          * pattern

            `"^[a-f0-9]{32}$"`

        * **[`pane_id`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization%2Fproperties%2Fpane_id)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * maxLength

            `32`

          * pattern

            `"^%[0-9]+$"`

        * **[`process_generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization%2Fproperties%2Fprocess_generation)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * maxLength

            `32`

          * pattern

            `"^[a-f0-9]{32}$"`

        * **[`run_id`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization%2Fproperties%2Frun_id)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * maxLength

            `32`

          * pattern

            `"^[a-f0-9]{32}$"`

        * **[`script_digest`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization%2Fproperties%2Fscript_digest)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * maxLength

            `64`

          * pattern

            `"^[a-f0-9]{64}$"`

        * **[`server_generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization%2Fproperties%2Fserver_generation)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * minLength

            `1`

          * maxLength

            `128`

        * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fauthorization%2Fproperties%2Fstate)** ("authorized")

        No other properties are accepted.

      * **[`completion`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)") | [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

        Matches exactly one variant.

        * **[Variant 1](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F0)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

          * **[`exit_status`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F0%2Fproperties%2Fexit_status)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

            * minimum

              `0`

            * maximum

              `255`

          * **[`signal`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F0%2Fproperties%2Fsignal)** ([null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

          * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F0%2Fproperties%2Fstate)** ("exited")

          No other properties are accepted.

        * **[Variant 2](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F1)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

          * **[`exit_status`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F1%2Fproperties%2Fexit_status)** ([null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

          * **[`signal`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F1%2Fproperties%2Fsignal)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

            * minimum

              `1`

            * maximum

              `255`

          * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fcompletion%2FoneOf%2F1%2Fproperties%2Fstate)** ("signaled")

          No other properties are accepted.

      * **[`stderr`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstderr)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

        * **[`bytes`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstderr%2Fproperties%2Fbytes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

          * minimum

            `0`

          * maximum

            `262144`

        * **[`data`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstderr%2Fproperties%2Fdata)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * maxLength

            `349528`

        * **[`encoding`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstderr%2Fproperties%2Fencoding)** ("utf-8" | "base64")

        * **[`truncated`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstderr%2Fproperties%2Ftruncated)** (false)

        No other properties are accepted.

      * **[`stdout`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstdout)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

        * **[`bytes`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstdout%2Fproperties%2Fbytes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

          * minimum

            `0`

          * maximum

            `262144`

        * **[`data`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstdout%2Fproperties%2Fdata)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

          * maxLength

            `349528`

        * **[`encoding`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstdout%2Fproperties%2Fencoding)** ("utf-8" | "base64")

        * **[`truncated`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Fstdout%2Fproperties%2Ftruncated)** (false)

        No other properties are accepted.

      * **[`target`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Ftarget)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

        Matches exactly one variant.

        * **[Variant 1](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Ftarget%2FoneOf%2F0)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

          * **[`generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Ftarget%2FoneOf%2F0%2Fproperties%2Fgeneration)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

            * minLength

              `1`

            * maxLength

              `128`

          * **[`id`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Ftarget%2FoneOf%2F0%2Fproperties%2Fid)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

            * maxLength

              `32`

            * pattern

              `"^%[0-9]+$"`

          * **[`kind`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fdata%2Fproperties%2Ftarget%2FoneOf%2F0%2Fproperties%2Fkind)** ("pane")

          No other properties are accepted.

      No other properties are accepted.

    * **[`ok`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F0%2Fproperties%2Fok)** (true)

    No other properties are accepted.

  * **[Variant 2](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

    * **[`error`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

      * **[`code`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Fcode)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

      * **[`delivery`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Fdelivery)** ("not_sent" | "possibly_sent" | "observed")

      * **[`effects`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects)**? ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

        * **[`authorization`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

          Matches exactly one variant.

          * **[Variant 1](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

            * **[`enrollment_generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0%2Fproperties%2Fenrollment_generation)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

              * maxLength

                `32`

              * pattern

                `"^[a-f0-9]{32}$"`

            * **[`pane_id`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0%2Fproperties%2Fpane_id)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

              * maxLength

                `32`

              * pattern

                `"^%[0-9]+$"`

            * **[`process_generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0%2Fproperties%2Fprocess_generation)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

              * maxLength

                `32`

              * pattern

                `"^[a-f0-9]{32}$"`

            * **[`run_id`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0%2Fproperties%2Frun_id)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

              * maxLength

                `32`

              * pattern

                `"^[a-f0-9]{32}$"`

            * **[`script_digest`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0%2Fproperties%2Fscript_digest)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

              * maxLength

                `64`

              * pattern

                `"^[a-f0-9]{64}$"`

            * **[`server_generation`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0%2Fproperties%2Fserver_generation)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

              * minLength

                `1`

              * maxLength

                `128`

            * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fauthorization%2FoneOf%2F0%2Fproperties%2Fstate)** ("authorized")

            No other properties are accepted.

        * **[`completion`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)") | [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)") | [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

          Matches exactly one variant.

          * **[Variant 1](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F0)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

            * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F0%2Fproperties%2Fstate)** ("unobserved")

            No other properties are accepted.

          * **[Variant 2](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F1)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

            * **[`exit_status`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F1%2Fproperties%2Fexit_status)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

              * minimum

                `0`

              * maximum

                `255`

            * **[`signal`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F1%2Fproperties%2Fsignal)** ([null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

            * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F1%2Fproperties%2Fstate)** ("exited")

            No other properties are accepted.

          * **[Variant 3](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F2)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

            * **[`exit_status`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F2%2Fproperties%2Fexit_status)** ([null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

            * **[`signal`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F2%2Fproperties%2Fsignal)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

              * minimum

                `1`

              * maximum

                `255`

            * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fcompletion%2FoneOf%2F2%2Fproperties%2Fstate)** ("signaled")

            No other properties are accepted.

        * **[`state`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Feffects%2Fproperties%2Fstate)** ("none" | "known" | "unknown")

        No other properties are accepted.

      * **[`message`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Ferror%2Fproperties%2Fmessage)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

      No other properties are accepted.

    * **[`ok`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.output%2FoneOf%2F1%2Fproperties%2Fok)** (false)

    No other properties are accepted.

  ## Annotations[#](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.annotations)

  * [`destructiveHint`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/reference/glossary/#openWorldHint)

    `false`

  * [`readOnlyHint`](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/ruby/v0.1.0.alpha.3/mcp/tools/tmux_run/#mcp.tool.tmux_run.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "script": {
        "maxLength": 65536,
        "pattern": "^[^\\u0000]*$",
        "type": "string"
      },
      "stderr_limit": {
        "maximum": 262144,
        "minimum": 0,
        "type": "integer"
      },
      "stdout_limit": {
        "maximum": 262144,
        "minimum": 0,
        "type": "integer"
      },
      "target": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "generation": {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              "id": {
                "maxLength": 32,
                "pattern": "^%[0-9]+$",
                "type": "string"
              },
              "kind": {
                "const": "pane"
              }
            },
            "required": [
              "generation",
              "kind",
              "id"
            ],
            "type": "object"
          }
        ]
      }
    },
    "required": [
      "target",
      "script"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "oneOf": [
      {
        "additionalProperties": false,
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "authorization": {
                "additionalProperties": false,
                "properties": {
                  "enrollment_generation": {
                    "maxLength": 32,
                    "pattern": "^[a-f0-9]{32}$",
                    "type": "string"
                  },
                  "pane_id": {
                    "maxLength": 32,
                    "pattern": "^%[0-9]+$",
                    "type": "string"
                  },
                  "process_generation": {
                    "maxLength": 32,
                    "pattern": "^[a-f0-9]{32}$",
                    "type": "string"
                  },
                  "run_id": {
                    "maxLength": 32,
                    "pattern": "^[a-f0-9]{32}$",
                    "type": "string"
                  },
                  "script_digest": {
                    "maxLength": 64,
                    "pattern": "^[a-f0-9]{64}$",
                    "type": "string"
                  },
                  "server_generation": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "state": {
                    "const": "authorized"
                  }
                },
                "required": [
                  "state",
                  "run_id",
                  "script_digest",
                  "server_generation",
                  "pane_id",
                  "enrollment_generation",
                  "process_generation"
                ],
                "type": "object"
              },
              "completion": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "exit_status": {
                        "maximum": 255,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "signal": {
                        "type": "null"
                      },
                      "state": {
                        "const": "exited"
                      }
                    },
                    "required": [
                      "state",
                      "exit_status",
                      "signal"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "exit_status": {
                        "type": "null"
                      },
                      "signal": {
                        "maximum": 255,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "state": {
                        "const": "signaled"
                      }
                    },
                    "required": [
                      "state",
                      "exit_status",
                      "signal"
                    ],
                    "type": "object"
                  }
                ]
              },
              "stderr": {
                "additionalProperties": false,
                "properties": {
                  "bytes": {
                    "maximum": 262144,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "data": {
                    "maxLength": 349528,
                    "type": "string"
                  },
                  "encoding": {
                    "enum": [
                      "utf-8",
                      "base64"
                    ]
                  },
                  "truncated": {
                    "const": false
                  }
                },
                "required": [
                  "encoding",
                  "data",
                  "bytes",
                  "truncated"
                ],
                "type": "object"
              },
              "stdout": {
                "additionalProperties": false,
                "properties": {
                  "bytes": {
                    "maximum": 262144,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "data": {
                    "maxLength": 349528,
                    "type": "string"
                  },
                  "encoding": {
                    "enum": [
                      "utf-8",
                      "base64"
                    ]
                  },
                  "truncated": {
                    "const": false
                  }
                },
                "required": [
                  "encoding",
                  "data",
                  "bytes",
                  "truncated"
                ],
                "type": "object"
              },
              "target": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "generation": {
                        "maxLength": 128,
                        "minLength": 1,
                        "type": "string"
                      },
                      "id": {
                        "maxLength": 32,
                        "pattern": "^%[0-9]+$",
                        "type": "string"
                      },
                      "kind": {
                        "const": "pane"
                      }
                    },
                    "required": [
                      "generation",
                      "kind",
                      "id"
                    ],
                    "type": "object"
                  }
                ]
              }
            },
            "required": [
              "target",
              "authorization",
              "completion",
              "stdout",
              "stderr"
            ],
            "type": "object"
          },
          "ok": {
            "const": true
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      {
        "additionalProperties": false,
        "properties": {
          "error": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "delivery": {
                "enum": [
                  "not_sent",
                  "possibly_sent",
                  "observed"
                ]
              },
              "effects": {
                "additionalProperties": false,
                "properties": {
                  "authorization": {
                    "oneOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "enrollment_generation": {
                            "maxLength": 32,
                            "pattern": "^[a-f0-9]{32}$",
                            "type": "string"
                          },
                          "pane_id": {
                            "maxLength": 32,
                            "pattern": "^%[0-9]+$",
                            "type": "string"
                          },
                          "process_generation": {
                            "maxLength": 32,
                            "pattern": "^[a-f0-9]{32}$",
                            "type": "string"
                          },
                          "run_id": {
                            "maxLength": 32,
                            "pattern": "^[a-f0-9]{32}$",
                            "type": "string"
                          },
                          "script_digest": {
                            "maxLength": 64,
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "server_generation": {
                            "maxLength": 128,
                            "minLength": 1,
                            "type": "string"
                          },
                          "state": {
                            "const": "authorized"
                          }
                        },
                        "required": [
                          "state",
                          "run_id",
                          "script_digest",
                          "server_generation",
                          "pane_id",
                          "enrollment_generation",
                          "process_generation"
                        ],
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "completion": {
                    "oneOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "state": {
                            "const": "unobserved"
                          }
                        },
                        "required": [
                          "state"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "exit_status": {
                            "maximum": 255,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "signal": {
                            "type": "null"
                          },
                          "state": {
                            "const": "exited"
                          }
                        },
                        "required": [
                          "state",
                          "exit_status",
                          "signal"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "exit_status": {
                            "type": "null"
                          },
                          "signal": {
                            "maximum": 255,
                            "minimum": 1,
                            "type": "integer"
                          },
                          "state": {
                            "const": "signaled"
                          }
                        },
                        "required": [
                          "state",
                          "exit_status",
                          "signal"
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  "state": {
                    "enum": [
                      "none",
                      "known",
                      "unknown"
                    ]
                  }
                },
                "required": [
                  "state",
                  "authorization",
                  "completion"
                ],
                "type": "object"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "delivery"
            ],
            "type": "object"
          },
          "ok": {
            "const": false
          }
        },
        "required": [
          "ok",
          "error"
        ],
        "type": "object"
      }
    ],
    "type": "object"
  }
  ```
