## Tool: `search_conversations`

> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.

Searches for Google Chat conversations to find conversation IDs. Named spaces are found by display name (`space_name_query`). Direct messages (DMs) and group chats are found only by participant email addresses (`participants`).

This tool searches conversation metadata, NOT message contents. To search within message history or find messages by keyword/sender/timestamp, use `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. Named spaces are not returned.

If only a `space_name_query` is provided, this tool searches ONLY named spaces where the query is a case-insensitive substring of the space's display name. DMs and group chats are never returned, so do NOT pass a person's name as `space_name_query` to find a DM with them; look up their email address and pass it in `participants` instead.

If both `participants` and `space_name_query` are provided, this tool finds DMs or group chats by participants and then filters them by display name.

If neither `participants` nor `space_name_query` are provided, this tool lists named spaces the calling user is a member of (DMs and group chats are not included).

This tool only lists conversations the calling user is a member of.

Returns a list of conversation objects containing conversation IDs (format: `spaces/{space}`), display names, and conversation types.

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.

The following code sample shows how to use `curl` to call the `search_conversations` MCP tool.

| Curl Request |
|---|
| ```bash 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 }' ``` |

## Input Schema

### SearchConversationsRequest

| JSON representation |
|---|
| ``` { "spaceNameQuery": string, "pageSize": integer, "pageToken": string, "participants": [ string ] } ``` |

| Fields ||
|---|---|
| `spaceNameQuery` | `string` Optional. The text to search for within conversation display names (case-insensitive substring match). If `participants` is empty, only named spaces are searched and direct messages (DMs) and group chats are never returned, so searching for a person's name here won't find a DM with them. To find a DM or group chat, provide the members' email addresses in `participants` instead. If `participants` is set, this query further filters the matched DMs or group chats by display name. |
| `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` Optional. A page token, received from a previous `search_conversations` call. Provide this to retrieve the subsequent page. |
| `participants[]` | `string` Optional. List of email addresses of the participants to filter the conversations, excluding the caller. Use this to find direct messages (DMs) and group chats: a single participant returns the 1:1 DM with that person, and multiple participants return group chats containing all of them. Named spaces are not returned when this field is set. |

## Output Schema

Response containing the list of matching conversations.

### SearchConversationsResponse

| JSON representation |
|---|
| ``` { "conversations": [ { object (`https://developers.google.com/workspace/chat/api/reference/mcp/tools_list/search_conversations#Output.Schema.Conversation`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `conversations[]` | ``object (`https://developers.google.com/workspace/chat/api/reference/mcp/tools_list/search_conversations#Output.Schema.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` A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. Only populated if the request is filtered by `participants`. |

### Conversation

| JSON representation |
|---|
| ``` { "conversationId": string, "displayName": string, "conversationType": enum (`https://developers.google.com/workspace/chat/api/reference/mcp/tools_list/search_messages#Input.Schema.ConversationType`), "lastActiveTimestamp": string } ``` |

| Fields ||
|---|---|
| `conversationId` | `string` The ID of the conversation (e.g., "spaces/AAAAAAAAA"). |
| `displayName` | `string` The display name of the conversation. For named spaces, this is the space name. For 1:1 direct messages, this is the other participant's name. For unnamed group chats, this is a generated name based on members' names. |
| `conversationType` | ``enum (`https://developers.google.com/workspace/chat/api/reference/mcp/tools_list/search_messages#Input.Schema.ConversationType`)`` The type of conversation (DIRECT_MESSAGE, GROUP_CHAT, or NAMED_SPACE). |
| `lastActiveTimestamp` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The last active time of the conversation in ISO 8601 format. 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"`. |

### Timestamp

| JSON representation |
|---|
| ``` { "seconds": string, "nanos": integer } ``` |

| Fields ||
|---|---|
| `seconds` | `string (https://developers.google.com/discovery/v1/type-format 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

Defines the type of conversation.

| Enums ||
|---|---|
| `CONVERSATION_TYPE_UNSPECIFIED` | Unspecified. |
| `NAMED_SPACE` | A named space. |
| `GROUP_CHAT` | A group chat between 3 or more people. |
| `DIRECT_MESSAGE` | A direct message between two humans, or a human and a Chat app. |

### Tool Annotations


[Tool annotations](https://modelcontextprotocol.io/specification/latest/schema#toolannotations) 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.


Along with the title string, the following boolean hints are defined as follows:

- `readOnlyHint`: If true, the tool doesn't modify its environment. Default: false.
- `destructiveHint`: If true, then the tool can perform destructive actions. If false, then the tool can only perform additive actions. Default: true.
- `idempotentHint`: If true, then calling the tool repeatedly with the same arguments will have no additional effect on its environment. Default: 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.

Destructive Hint: ❌ \| Idempotent Hint: ✅ \| Read Only Hint: ✅ \| Open World Hint: ❌

## Authorization Scopes

Requires one of the following OAuth scopes:

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