# MCP: sessions

Source: <https://telegafirst.com/docs/mcp-sessions>
Locale: ru
releaseGitSha: c9a428d902de0b479a981e43774f38b9ec077ed7
sourceContentDigest: 8d940f2c106e9d9c20085efd45a177a2d31e49faf9e5a1ac1d59ed9ef9ac12e2
Version: 1

# MCP: sessions

Это определения инструментов из текущего ToolRegistry, включая полные inputSchema/outputSchema, scope, required\_scopes (ALL), risk и версию платформы. Наличие определения не означает, что инструмент уже установлен вашим хостом или разрешён вашим credential. Обновляйте tools/list после изменения бизнеса, readiness и прав. Progressive disclosure через load\_domain/describe\_tool и существующий meta-dispatch описаны в [MCP-руководстве](https://telegafirst.com/docs/mcp-guide). [Scopes и права](https://telegafirst.com/docs/scopes-and-permissions) применяются при вызове; risk не заменяет согласие и отдельные требования денежной операции. JSON ниже — схема, а не успешный результат вызова.

## create\_session

Create a third-party login / link / pay session that the user confirms in-bot.

```json
{
  "description": "Create a third-party login / link / pay session that the user confirms in-bot.",
  "domain": "sessions",
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "bot": {
        "description": "Optional slug of the bot you expect to act on (get_active_bot). If the active bot differs, the call is refused with ACTIVE_BOT_CHANGED and nothing runs.",
        "maxLength": 128,
        "minLength": 1,
        "type": "string"
      },
      "external_user_id": {
        "description": "Value for external user id.",
        "maxLength": 255,
        "type": "string"
      },
      "login_session_id": {
        "description": "Value for login session id.",
        "maxLength": 255,
        "type": "string"
      },
      "metadata": {
        "additionalProperties": {},
        "description": "Value for metadata.",
        "propertyNames": {
          "type": "string"
        },
        "type": "object"
      },
      "product_seq_id": {
        "description": "Value for product seq id.",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991,
        "type": "integer"
      },
      "redirect_url": {
        "description": "Value for redirect url.",
        "format": "uri",
        "maxLength": 2048,
        "type": "string"
      },
      "type": {
        "description": "Value for type.",
        "enum": [
          "LOGIN",
          "LINK",
          "OPEN_BILLING",
          "PAY_PRODUCT",
          "OPEN_SUPPORT"
        ],
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "name": "create_session",
  "outputSchema": null,
  "platform_version": "1.0.19",
  "required_scopes": [
    "sessions"
  ],
  "risk": "write",
  "scope": "sessions",
  "title": "Create Session"
}
```

## exchange\_session\_approval\_code

Exchange an approval\_code for access + refresh tokens.

```json
{
  "description": "Exchange an approval_code for access + refresh tokens.",
  "domain": "sessions",
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "approval_code": {
        "description": "Value for approval code.",
        "minLength": 1,
        "type": "string"
      },
      "bot": {
        "description": "Optional slug of the bot you expect to act on (get_active_bot). If the active bot differs, the call is refused with ACTIVE_BOT_CHANGED and nothing runs.",
        "maxLength": 128,
        "minLength": 1,
        "type": "string"
      }
    },
    "required": [
      "approval_code"
    ],
    "type": "object"
  },
  "name": "exchange_session_approval_code",
  "outputSchema": null,
  "platform_version": "1.0.19",
  "required_scopes": [
    "sessions"
  ],
  "risk": "write",
  "scope": "sessions",
  "title": "Exchange Session Approval Code"
}
```

## get\_session\_status

Poll session state (pending / approved / denied / expired).

```json
{
  "description": "Poll session state (pending / approved / denied / expired).",
  "domain": "sessions",
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "session_id": {
        "description": "Value for session id.",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
        "type": "string"
      }
    },
    "required": [
      "session_id"
    ],
    "type": "object"
  },
  "name": "get_session_status",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "approval_code": {
        "type": "string"
      },
      "session_id": {
        "type": "string"
      },
      "state": {
        "type": "string"
      },
      "user": {
        "anyOf": [
          {
            "additionalProperties": false,
            "properties": {
              "seq_id": {
                "exclusiveMinimum": 0,
                "maximum": 2147483647,
                "type": "integer"
              }
            },
            "required": [
              "seq_id"
            ],
            "type": "object"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "session_id",
      "state",
      "user"
    ],
    "type": "object"
  },
  "platform_version": "1.0.19",
  "required_scopes": [
    "sessions"
  ],
  "risk": "read",
  "scope": "sessions",
  "title": "Get Session Status"
}
```
