MCP Tools Reference: chatmcp.googleapis.com

Инструмент: search_conversations

Поиск диалогов в Google Chat (в именованных пространствах, личных сообщениях или групповых чатах) по отображаемому имени или участникам для определения идентификаторов диалогов.

Этот инструмент ищет метаданные переписки, а НЕ содержимое сообщений. Для поиска в истории сообщений или поиска сообщений по ключевому слову/отправителю/временной метке используйте search_messages .

If only participants are provided, this tool finds 1:1 direct messages (if one participant is provided) or group chats (if multiple participants are provided) that include the specified participants and the calling user.

Если указан только query , этот инструмент ищет беседы, в которых запрос представляет собой подстроку отображаемого имени беседы без учета регистра.

Если указаны и participants , и query , этот инструмент находит беседы по участникам, а затем фильтрует их по отображаемому имени.

Если ни participants , ни query не указаны, этот инструмент отображает список всех разговоров, в которых участвует вызывающий пользователь.

Этот инструмент отображает только те беседы, в которых участвует вызывающий пользователь.

Возвращает список объектов диалогов, содержащих идентификаторы диалогов (формат: spaces/{space} ), отображаемые имена и типы диалогов.

IMPORTANT: An empty conversations list does not mean there are no more results overall. If next_page_token is present, more pages can be fetched. If you get an empty list but a next_page_token , ask the user if you should continue the searching.

Приведённый ниже пример кода демонстрирует, как использовать curl для вызова инструмента MCP search_conversations .

Запрос Curl
curl --location 'https://chatmcp.googleapis.com/mcp/v1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "search_conversations",
    "arguments": {
      // Provide these details according to the MCP tool specification.
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

Схема ввода

SearchConversationsRequest

JSON-представление
{
  "spaceNameQuery": string,
  "pageSize": integer,
  "pageToken": string,
  "participants": [
    string
  ]
}
Поля
spaceNameQuery

string

Необязательно. Текст для поиска в отображаемых именах в пространстве (совпадение подстрок без учета регистра).

pageSize

integer

Optional. The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 20 spaces will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

pageToken

string

Необязательный параметр. Токен страницы, полученный из предыдущего вызова search_conversations . Укажите его, чтобы получить следующую страницу.

participants[]

string

Необязательно. Список адресов электронной почты участников для фильтрации разговоров, исключая звонившего.

Схема вывода

Ответ, содержащий список соответствующих диалогов.

SearchConversationsResponse

JSON-представление
{
  "conversations": [
    {
      object (Conversation)
    }
  ],
  "nextPageToken": string
}
Поля
conversations[]

object ( Conversation )

List of conversation objects that match the search criteria. Each conversation includes the conversation_id (format: spaces/{space}), display_name, conversation_type, and last_active_timestamp.

nextPageToken

string

Токен, который можно отправить в качестве page_token для получения следующей страницы. Если это поле опущено, последующих страниц не будет.

Заполняется только в том случае, если запрос отфильтрован по participants .

Беседа

JSON-представление
{
  "conversationId": string,
  "displayName": string,
  "conversationType": enum (ConversationType),
  "lastActiveTimestamp": string
}
Поля
conversationId

string

Идентификатор беседы (например, "spaces/AAAAAAAAAA").

displayName

string

Отображаемое имя беседы.

conversationType

enum ( ConversationType )

Тип беседы (DIRECT_MESSAGE, GROUP_CHAT или NAMED_SPACE).

lastActiveTimestamp

string ( Timestamp format)

Время последней активности разговора в формате ISO 8601.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .

Отметка времени

JSON-представление
{
  "seconds": string,
  "nanos": integer
}
Поля
seconds

string ( int64 format)

Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).

nanos

integer

Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive.

ConversationType

Определяет тип разговора.

Перечисления
CONVERSATION_TYPE_UNSPECIFIED Не указано.
NAMED_SPACE Названное пространство.
GROUP_CHAT Групповой чат с участием 3 или более человек.
DIRECT_MESSAGE Прямое сообщение между двумя людьми или между человеком и приложением для чата.

Аннотации инструментов

Tool annotations are sent to MCP clients to describe the basic risk of a given tool. Most clients treat these hints as untrusted, but they can be used to decide when a confirmation prompt might be sent to a user.

Наряду со строкой заголовка, определены следующие логические подсказки:

  • readOnlyHint : Если true, инструмент не изменяет свою среду. По умолчанию: false.
  • destructiveHint : Если true, то инструмент может выполнять деструктивные действия. Если false, то инструмент может выполнять только аддитивные действия. По умолчанию: true.
  • idempotentHint : Если true, то многократный вызов инструмента с одними и теми же аргументами не окажет дополнительного влияния на его окружение. По умолчанию: false.
  • openWorldHint : If true, then the tool can interact with an 'open world' of external entities. If false, then the tool can only interact with internal entities. For example, a web search tool would be open world, while a memory tool would not be open world.

Подсказка о разрушительном эффекте: ❌ | Подсказка об идемпотентности: ✅ | Подсказка только для чтения: ✅ | Подсказка об открытом мире: ❌

Области полномочий

Требуется один из следующих диапазонов аутентификации OAuth:

  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly