# get_session_info

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

> Return metadata for a single tmux session (ID, name, window count, activity).

MCP is in development

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

Return metadata for a single tmux session (ID, name, window count, activity).

Use this instead of [list_sessions](https://libtmux.org/en/py/latest/mcp/tools/list_sessions/) + filter when you only need one session’s info. Resolves by session_id first; falls back to session_name.

[All Python tools](https://libtmux.org/en/py/latest/mcp/tools/) · [JSON](https://libtmux.org/en/py/latest/mcp/tools/get_session_info.json) · [Source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/session_tools.py#L359)

## Arguments

* `session_id` optional

  Session ID (e.g. '$0').

  Default: `null`.

* `session_name` optional

  Session name.

  Default: `null`.

* `socket_name` optional

  tmux socket name.

  Default: `null`.

## Schemas

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

Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Session ID (e.g. '$0')."
    },
    "session_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Session name."
    },
    "socket_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "tmux socket name."
    }
  },
  "type": "object"
}
```

Output schema

```json
{
  "description": "Serialized tmux session.",
  "properties": {
    "active_pane_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Pane id (``%N``) of the session's active pane. Guaranteed non-None on ``create_session`` return (libtmux creates the session with one initial pane). May be None from ``list_sessions`` rows for sessions in transient teardown states where ``active_pane`` is unavailable."
    },
    "session_attached": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Attached client count"
    },
    "session_created": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Creation timestamp"
    },
    "session_id": {
      "description": "Session ID (e.g. '$1')",
      "type": "string"
    },
    "session_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Session name"
    },
    "window_count": {
      "description": "Number of windows",
      "type": "integer"
    }
  },
  "required": [
    "session_id",
    "window_count"
  ],
  "type": "object"
}
```

Tool annotations

```json
{
  "destructiveHint": true,
  "idempotentHint": false,
  "openWorldHint": true,
  "readOnlyHint": false
}
```
