# rename_session

Source: https://libtmux.org/en/ts/latest/mcp/tools/rename_session/

> Change tmux state; no client-supplied executable input. Rename a session. Its id does not change, so targets by id keep working.

tool MCPlatest

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)

* **rename_session**( [name](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.input%2Fproperties%2Fname): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [session](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.input%2Fproperties%2Fsession): [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), )

  tool \[[source](https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/mcp/src/tools/lifecycle.ts#L234)][¶](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session)

  Change tmux state; no client-supplied executable input. Rename a session. Its id does not change, so targets by id keep working.

  * MCP request method

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

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

  * **[`name`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.input%2Fproperties%2Fname)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    The session’s new name.

  * **[`session`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.input%2Fproperties%2Fsession)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Session id ($1) or name.

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

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

  * **[`session`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

    * **[`attachedClients`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession%2Fproperties%2FattachedClients)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      Raw client count from tmux; 0 means detached. Includes control-mode clients - this server’s own [wait_for_text](https://libtmux.org/en/ts/latest/mcp/tools/wait_for_text/) or other live read holds one open while it runs, and another program on this socket may hold others. See humanAttachedClients for a person-only count.

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

    * **[`humanAttachedClients`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession%2Fproperties%2FhumanAttachedClients)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      attachedClients minus every control-mode client, this server’s own included.

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

    * **[`id`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession%2Fproperties%2Fid)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

      Stable session id, e.g. $1.

      * pattern

        `"^\\$\\d+$"`

    * **[`metadataComplete`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession%2Fproperties%2FmetadataComplete)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

      Whether the session name is complete.

    * **[`name`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession%2Fproperties%2Fname)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    * **[`omittedMetadataBytes`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession%2Fproperties%2FomittedMetadataBytes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      UTF-8 bytes omitted from the session name.

      * minimum

        `0`

      * maximum

        `9007199254740991`

    * **[`windows`](https://libtmux.org/en/ts/latest/mcp/tools/rename_session/#mcp.tool.rename_session.output%2Fproperties%2Fsession%2Fproperties%2Fwindows)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      How many windows it holds.

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

    No other properties are accepted.

  No other properties are accepted.

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

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

    `true`

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

    `false`

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

    `true`

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

    `false`

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

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "name": {
        "description": "The session's new name.",
        "type": "string",
        "x-libtmux-tmux-format": "literalized-once"
      },
      "session": {
        "description": "Session id ($1) or name.",
        "type": "string"
      }
    },
    "required": [
      "name",
      "session"
    ],
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "properties": {
      "session": {
        "additionalProperties": false,
        "properties": {
          "attachedClients": {
            "description": "Raw client count from tmux; 0 means detached. Includes control-mode clients - this server's own wait_for_text or other live read holds one open while it runs, and another program on this socket may hold others. See humanAttachedClients for a person-only count.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "humanAttachedClients": {
            "description": "attachedClients minus every control-mode client, this server's own included.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "id": {
            "description": "Stable session id, e.g. $1.",
            "pattern": "^\\$\\d+$",
            "type": "string"
          },
          "metadataComplete": {
            "description": "Whether the session name is complete.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "omittedMetadataBytes": {
            "description": "UTF-8 bytes omitted from the session name.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "windows": {
            "description": "How many windows it holds.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          }
        },
        "required": [
          "attachedClients",
          "humanAttachedClients",
          "id",
          "metadataComplete",
          "name",
          "omittedMetadataBytes",
          "windows"
        ],
        "type": "object"
      }
    },
    "required": [
      "session"
    ],
    "type": "object"
  }
  ```
