MCP Control
Чаты · Чтение

Чаты · Сообщения · Просмотр

chat_messages_get
Контактные карточки и телефон

Попробуйте три запроса

Получить данные
  1. Вы указываетеЧат
  2. ПомощникЧтение
  3. Вы получаетеПоля ответа
Запрос в чат
Для задачи «Чаты / Сообщения / Просмотр» выполни чтение по выбранной записи (чат). Выведи кратко: interactive, interactiveState.
Что искать в ответе
interactive
Поле ответа
interactiveState
Поле ответа
internalChatId
Поле ответа
Задать параметры
  1. Вы указываетеЧат
  2. ПомощникСверка выбора
  3. Вы получаетеТочный объект
Запрос в чат
Покажи, как получить «Чаты / Сообщения / Просмотр» на учебном примере с chatId = DEMO-101. Объясни, какие ещё данные нужны и как будет выглядеть ответ.
Фрагмент учебных параметров
chatId
DEMO-101
messageId
DEMO-101
sessionId
DEMO-101
Разобрать ответ
  1. Вы указываетеПолученный ответ
  2. ПомощникРазбор значений
  3. Вы получаетеКраткое пояснение
Запрос в чат
На основании уже полученного ответа «Чаты / Сообщения / Просмотр» объясни interactive, interactiveState. Отметь отсутствующие значения.
Поля для проверки
interactive
Поле ответа
interactiveState
Поле ответа
internalChatId
Поле ответа
Как работает действие

Это чтение. Выберите запись или задайте фильтры в доступной компании.

Описание разработчика

Read one native message only after checking its current parent company and participant access. Optional sessionId rejects a different session. Media references are preserved as hints; actual resource access is checked by Media/Documents Actions. OAuth URL text stays in the native UI and is always omitted from MCP/AI responses.

Параметры запроса
chatId
Existing native chatai document ID in the authenticated company and participant list. обязательно по схеме · string
messageId
Message ID under this exact chat; never a path into another chat. обязательно по схеме · string
sessionId
Optional expected session ID; a mismatch returns not found. необязательно · string
Что вернёт команда
interactive
Validated saved card definition and current revision. необязательно · object
interactiveState
Current live values and recorded participant responses. необязательно · object
internalChatId
Canonical human parent chat ID. необязательно · string
messageId
Message ID under this exact chat; never a path into another chat. обязательно по схеме · string
revision
Exact Firestore update-time revision returned by the corresponding get action. No revision field is stored in the native document. обязательно по схеме · string
sessionId
Flow/Chat operation session ID preserved on this message; never an authorization credential. обязательно по схеме · string
replyToMessageId
Existing message in the same chat and session, or empty string for a top-level message. обязательно по схеме · string / string
sender
Authenticated user UID or the server-owned native agent sender. The client cannot choose a sender. обязательно по схеме · string
text
Stored message text with sensitive values redacted. обязательно по схеме · string · до символов 50000
type
Native message type. credential is only an empty-reference secure-input placeholder; oauth requires a server-verified authorization reference and URL. обязательно по схеме · string · варианты text, image, file, document, order, customer, task, product, oauth, credential
createdAt
Native server timestamp rendered as UTC ISO 8601. обязательно по схеме · string
referenceId
Optional native reference ID hint. It never authorizes access to the referenced business resource. credential messages must initially use an empty reference. обязательно по схеме · string / string
attachments
Up to ten existing internal media references. Each retains its own company and resource permission checks. обязательно по схеме · array · до элементов 10
Поля и технические схемы
Входные поля и поля ответа chat_messages_get
Вход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "chatId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Existing native chatai document ID in the authenticated company and participant list."
    },
    "messageId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Message ID under this exact chat; never a path into another chat."
    },
    "sessionId": {
      "description": "Optional expected session ID; a mismatch returns not found.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
    }
  },
  "required": [
    "chatId",
    "messageId"
  ],
  "additionalProperties": false
}
Выход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "interactive": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema0"
      },
      "description": "Validated saved card definition and current revision."
    },
    "interactiveState": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema1"
      },
      "description": "Current live values and recorded participant responses."
    },
    "internalChatId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Canonical human parent chat ID."
    },
    "messageId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Message ID under this exact chat; never a path into another chat."
    },
    "revision": {
      "type": "string",
      "pattern": "^fsv1:-?\\d{1,12}:\\d{1,9}$",
      "description": "Exact Firestore update-time revision returned by the corresponding get action. No revision field is stored in the native document."
    },
    "sessionId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Flow/Chat operation session ID preserved on this message; never an authorization credential."
    },
    "replyToMessageId": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
        },
        {
          "type": "string",
          "const": ""
        }
      ],
      "description": "Existing message in the same chat and session, or empty string for a top-level message."
    },
    "sender": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Authenticated user UID or the server-owned native agent sender. The client cannot choose a sender."
    },
    "text": {
      "type": "string",
      "maxLength": 50000,
      "description": "Stored message text with sensitive values redacted."
    },
    "type": {
      "type": "string",
      "enum": [
        "text",
        "image",
        "file",
        "document",
        "order",
        "customer",
        "task",
        "product",
        "oauth",
        "credential"
      ],
      "description": "Native message type. credential is only an empty-reference secure-input placeholder; oauth requires a server-verified authorization reference and URL."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "description": "Native server timestamp rendered as UTC ISO 8601."
    },
    "referenceId": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
        },
        {
          "type": "string",
          "const": ""
        }
      ],
      "description": "Optional native reference ID hint. It never authorizes access to the referenced business resource. credential messages must initially use an empty reference."
    },
    "attachments": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "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",
            "pattern": "^file:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          {
            "type": "string",
            "pattern": "^Companies\\/[A-Za-z0-9_~:@+.-]{1,128}\\/Documents\\/[A-Za-z0-9_~:@+.-]{1,128}$"
          }
        ],
        "description": "Existing managed image UUID from media_get, file:<UUID> reference returned by the managed file service, or canonical Companies/{company}/Documents/{documentId} reference. Server checks company and underlying resource access. No URL, Storage path, query, inline bytes or base64."
      },
      "description": "Up to ten existing internal media references. Each retains its own company and resource permission checks."
    }
  },
  "required": [
    "messageId",
    "revision",
    "sessionId",
    "replyToMessageId",
    "sender",
    "text",
    "type",
    "createdAt",
    "referenceId",
    "attachments"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    },
    "__schema1": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema1"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema1"
          }
        }
      ]
    }
  }
}