# set_option

Source: https://libtmux.org/en/py/latest/mcp/tools/set_option/

> Set a tmux option value.

tool MCPlatest

MCP is in development

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

* **set_option**( [global\_](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.input%2Fproperties%2Fglobal_)?: [boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"), [option](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.input%2Fproperties%2Foption): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [scope](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.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/latest/mcp/tools/set_option/#mcp.tool.set_option.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/latest/mcp/tools/set_option/#mcp.tool.set_option.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)"), [value](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.input%2Fproperties%2Fvalue): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), )

  tool \[[source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/option_tools.py#L158)][¶](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option)

  Set a tmux option value.

  Some option values are executable. tmux runs a `#(...)` job inside the status formats when it draws them, and repeats it on the status interval; [`default-command`](https://libtmux.org/en/tmux/latest/catalog/options/default-command/) and [`default-shell`](https://libtmux.org/en/tmux/latest/catalog/options/default-shell/) decide what every future pane runs, and [`command-alias`](https://libtmux.org/en/tmux/latest/catalog/options/command-alias/) rewrites later commands. The value is stored verbatim, so an option that interprets it later runs what is stored, not what this call did.

  Use to change tmux behavior at runtime. Common uses: adjusting history-limit, enabling mouse support, changing status bar format.

  * MCP request method

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

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

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

    Whether to set the global option.

  * **[`option`](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.input%2Fproperties%2Foption)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    The tmux option name to set.

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

    Option scope.

  * **[`socket_name`](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.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/latest/mcp/tools/set_option/#mcp.tool.set_option.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 (e.g. ‘mysession’). For window scope: window ID (e.g. ‘@1’). For pane scope: pane ID (e.g. ‘%1’). Requires scope.

  * **[`value`](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.input%2Fproperties%2Fvalue)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    The value to set.

  No other arguments are accepted.

  ## Result[#](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.result)

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

  * **[`option`](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.output%2Fproperties%2Foption)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Option name

  * **[`status`](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.output%2Fproperties%2Fstatus)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Operation status

  * **[`value`](https://libtmux.org/en/py/latest/mcp/tools/set_option/#mcp.tool.set_option.output%2Fproperties%2Fvalue)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Value that was set

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

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

    `true`

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

    `false`

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

    `true`

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

    `false`

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

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "global_": {
        "default": false,
        "description": "Whether to set the global option.",
        "type": "boolean"
      },
      "option": {
        "description": "The tmux option name to set.",
        "type": "string"
      },
      "scope": {
        "anyOf": [
          {
            "enum": [
              "server",
              "session",
              "window",
              "pane"
            ],
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Option scope."
      },
      "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\n(e.g. 'mysession'). For window scope: window ID (e.g. '@1').\nFor pane scope: pane ID (e.g. '%1'). Requires scope."
      },
      "value": {
        "description": "The value to set.",
        "type": "string"
      }
    },
    "required": [
      "option",
      "value"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "description": "Result of a set_option call.",
    "properties": {
      "option": {
        "description": "Option name",
        "type": "string"
      },
      "status": {
        "description": "Operation status",
        "type": "string"
      },
      "value": {
        "description": "Value that was set",
        "type": "string"
      }
    },
    "required": [
      "option",
      "value",
      "status"
    ],
    "type": "object"
  }
  ```
