# Telegram

> Инструменты раздела «Telegram»: 5

Подключение: `https://mcp.legalstack.ru/mcp/telegram` или в составе общего подключения `https://mcp.legalstack.ru/mcp`.

## Спросить пользователя в Telegram

`ask_telegram_question` · изменяет данные

Описание для модели: Ask the user a question in Telegram and wait for the answer. With options the user picks a button, otherwise answers in text. When answered is false the user has not replied yet, read the answer later with get_telegram_answer.

**Параметры**

| Параметр | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `question` | string | да | Question text. Длина: 1–3000. |
| `options` | массив string | нет | Answer buttons. Элементов: 2–10. |
| `wait_seconds` | integer | нет | Seconds to wait for the answer, 120 by default. По умолчанию: `120`. Диапазон: 0–240. |

<details>
<summary>JSON Schema параметров</summary>

```json
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "minLength": 1,
      "maxLength": 3000,
      "description": "Question text"
    },
    "options": {
      "description": "Answer buttons",
      "minItems": 2,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60,
        "description": "Text of the button"
      }
    },
    "wait_seconds": {
      "default": 120,
      "description": "Seconds to wait for the answer, 120 by default",
      "type": "integer",
      "minimum": 0,
      "maximum": 240
    }
  },
  "required": [
    "question"
  ],
  "additionalProperties": false
}
```

</details>

## Ответ на вопрос в Telegram

`get_telegram_answer` · только чтение

Описание для модели: Get the answer to a question asked in Telegram.

**Параметры**

| Параметр | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `question_id` | string | да | Question id. Длина: 1–64. |
| `wait_seconds` | integer | нет | Seconds to wait for the answer, 120 by default. По умолчанию: `120`. Диапазон: 0–240. |

<details>
<summary>JSON Schema параметров</summary>

```json
{
  "type": "object",
  "properties": {
    "question_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Question id"
    },
    "wait_seconds": {
      "default": 120,
      "description": "Seconds to wait for the answer, 120 by default",
      "type": "integer",
      "minimum": 0,
      "maximum": 240
    }
  },
  "required": [
    "question_id"
  ],
  "additionalProperties": false
}
```

</details>

## Отправить файл в Telegram

`send_telegram_file` · необратимое действие · только для агентов платформы

Описание для модели: Send a file to a team member in Telegram.

**Параметры**

| Параметр | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `member_id` | string | да | Recipient, a member id from list_members. Длина: 1–64. |
| `path` | string | да | Path of the file in the working folder. Длина: 1–1000. |
| `caption` | string | нет | Caption, plain text, may use the HTML tags b, i, code and a. Длина: до 1000. |

<details>
<summary>JSON Schema параметров</summary>

```json
{
  "type": "object",
  "properties": {
    "member_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Recipient, a member id from list_members"
    },
    "path": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000,
      "description": "Path of the file in the working folder"
    },
    "caption": {
      "description": "Caption, plain text, may use the HTML tags b, i, code and a",
      "type": "string",
      "maxLength": 1000
    }
  },
  "required": [
    "member_id",
    "path"
  ],
  "additionalProperties": false
}
```

</details>

## Отправить форму в Telegram

`send_telegram_form` · необратимое действие

Описание для модели: Send a published form to a team member to fill in Telegram. The form token comes from publish_interface.

**Параметры**

| Параметр | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `member_id` | string | да | Recipient, a member id from list_members. Длина: 1–64. |
| `form_token` | string | да | Public token of the published form. Длина: 1–200. |

<details>
<summary>JSON Schema параметров</summary>

```json
{
  "type": "object",
  "properties": {
    "member_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Recipient, a member id from list_members"
    },
    "form_token": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Public token of the published form"
    }
  },
  "required": [
    "member_id",
    "form_token"
  ],
  "additionalProperties": false
}
```

</details>

## Написать в Telegram

`send_telegram_message` · необратимое действие

Описание для модели: Send a Telegram message to a team member. The member must have Telegram connected to the platform bot.

**Параметры**

| Параметр | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `member_id` | string | да | Recipient, a member id from list_members. Длина: 1–64. |
| `text` | string | да | Message, plain text, may use the HTML tags b, i, code and a. Длина: 1–4000. |

<details>
<summary>JSON Schema параметров</summary>

```json
{
  "type": "object",
  "properties": {
    "member_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Recipient, a member id from list_members"
    },
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000,
      "description": "Message, plain text, may use the HTML tags b, i, code and a"
    }
  },
  "required": [
    "member_id",
    "text"
  ],
  "additionalProperties": false
}
```

</details>
