# Google Chat

## Links

- Product page URL: https://www.agentpmt.com/marketplace/google-chat
- Product markdown URL: https://www.agentpmt.com/marketplace/google-chat?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/google-chat?format=agent-json

## Overview

- Product ID: 6968000436a6023a803ab753
- Type: connector
- Unit type: request
- Price: 500 credits
- Categories: Task Planning & Orchestration, Project Management, Automation, Team Collaboration & Workspaces, Task & Workflow Automation
- Generated at: 2026-07-14T22:10:24.494Z

### Page Description

Bridge your agent to your Google Chat spaces—post updates, keep threads moving, and turn routine teamwork into quick, automated nudges that keep everyone in sync. Supports reactions, direct messaging, and posting and reading in spaces. All actions take place as the connected user.

### Agent Description

Read/search Google Chat spaces and messages, send messages and replies with File Manager attachments, download Chat attachments, and manage reactions as the connected user.

## Details

### Details

Bridge your agent to your Google Chat spaces—post updates, keep threads moving, and turn routine teamwork into quick, automated nudges that keep everyone in sync. Supports reactions, direct messaging, and posting and reading in spaces. All actions take place as the connected user.

### Actions

- `list_spaces` (5 credits): List accessible spaces.
- `get_space` (5 credits): Get a space.
- `search_spaces` (5 credits): Search accessible spaces.
- `find_direct_message` (5 credits): Find a DM space.
- `list_messages` (5 credits): List messages; newest first by default.
- `get_message` (5 credits): Get a message.
- `search_messages` (5 credits): Bounded message search in one space.
- `create_message` (5 credits): Create a message, optionally with files.
- `reply_message` (5 credits): Reply to a message, optionally with files.
- `update_message` (5 credits): Update message text/cards.
- `delete_message` (5 credits): Delete a message.
- `list_reactions` (5 credits): List message reactions.
- `add_reaction` (5 credits): Add a reaction.
- `delete_reaction` (5 credits): Delete a reaction.
- `list_message_attachments` (5 credits): List message attachments.
- `get_attachment` (5 credits): Get attachment metadata from its message.
- `search_attachments` (5 credits): Bounded attachment search in one space.
- `upload_attachment` (5 credits): Upload a File Manager file to Chat.
- `download_attachment_to_storage` (5 credits): Download Chat media to File Manager.

### Use Cases

Search accessible spaces, Find direct-message spaces, Read and search messages, Send messages and replies, Attach File Manager files to Chat messages, Download Chat attachments to File Manager, Add or remove reactions, Automate team notifications

### Workflows Using This Tool

No public workflows currently reference this product.

### Related Content

No related content is currently linked to this product.

## Integration Details

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp#platform=claude
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp#platform=chatgpt
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp#platform=cursor
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp#platform=windsurf

Use the local router for command-based MCP clients. It forwards requests to `https://api.agentpmt.com/mcp` and does not execute tools locally.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "6968000436a6023a803ab753",
    "parameters": {
      "action": "list_spaces"
    }
  }'
```

### Autonomous Agents

Autonomous agents can access this tool through AgentAddress credit balances or direct x402 payments. Use the Autonomous Agent API reference for endpoint shapes after choosing the access pattern below.

- Autonomous Agent API reference URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents
- Autonomous Agent API reference markdown URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents?format=agent-md
- Credit-Based Access Using AgentAddress: https://www.agentpmt.com/docs/autonomous-agents/credit-based-tool-usage-with-agentaddress
- AgentAddress is preferred for persistent file access, stored platform state, and maximum tool use ability across repeated calls.
- Direct x402 is for independent one-off tool calls that do not require shared files or stored platform state.
- Direct x402 public payments: USDC on Base, Arbitrum, Optimism, Polygon, and Avalanche.

#### Product Skill Package

This product has a published Agent Skill package for product-specific operating instructions.

- Skill slug: google-chat
- Version: 1.0.1
- Download SKILL.md: https://raw.githubusercontent.com/AgentPMT/agent-skills/main/skills/google-chat/SKILL.md
- Package source: https://github.com/AgentPMT/agent-skills/tree/main/skills/google-chat
- OpenClaw listing: https://clawhub.ai/agentpmt/google-chat
- OpenClaw install: `openclaw skills install google-chat`
- skills.sh install: `npx skills add AgentPMT/agent-skills --skill google-chat`
- Last published: 2026-06-29T18:25:53.992Z

### Schema

#### Credentials

These runtime credentials should be provided under `parameters._credentials` when required.

- Google OAuth (`google_oauth`, oauth_token, required)
  Help: Connect your Google account.
  Connection ID: 69616abea90ed54743f01957

#### Parameters

- Schema type: actions

```json
{
  "actions": {
    "list_spaces": {
      "description": "List accessible spaces.",
      "properties": {
        "page_size": {
          "type": "integer",
          "description": "Page size.",
          "required": false
        },
        "page_token": {
          "type": "string",
          "description": "Next page token.",
          "required": false
        },
        "filter": {
          "type": "string",
          "description": "spaces.list filter.",
          "required": false
        }
      }
    },
    "get_space": {
      "description": "Get a space.",
      "properties": {
        "space": {
          "type": "string",
          "description": "Space name or ID.",
          "required": true
        }
      }
    },
    "search_spaces": {
      "description": "Search accessible spaces.",
      "properties": {
        "query": {
          "type": "string",
          "description": "Space search query.",
          "required": true
        },
        "page_size": {
          "type": "integer",
          "description": "Page size.",
          "required": false
        },
        "page_token": {
          "type": "string",
          "description": "Next page token.",
          "required": false
        },
        "order_by": {
          "type": "string",
          "description": "Space sort order.",
          "required": false,
          "enum": [
            "create_time DESC",
            "relevance DESC"
          ]
        }
      }
    },
    "find_direct_message": {
      "description": "Find a DM space.",
      "properties": {
        "user_name": {
          "type": "string",
          "description": "User name, e.g. users/123.",
          "required": true
        }
      }
    },
    "list_messages": {
      "description": "List messages; newest first by default.",
      "properties": {
        "space": {
          "type": "string",
          "description": "Space name or ID.",
          "required": true
        },
        "page_size": {
          "type": "integer",
          "description": "Page size.",
          "required": false
        },
        "page_token": {
          "type": "string",
          "description": "Next page token.",
          "required": false
        },
        "filter": {
          "type": "string",
          "description": "Message filter.",
          "required": false
        },
        "order_by": {
          "type": "string",
          "description": "Message sort order.",
          "required": false,
          "enum": [
            "create_time DESC",
            "create_time ASC",
            "createTime DESC",
            "createTime ASC"
          ]
        },
        "show_deleted": {
          "type": "boolean",
          "description": "Include deleted messages.",
          "required": false
        }
      }
    },
    "get_message": {
      "description": "Get a message.",
      "properties": {
        "message_name": {
          "type": "string",
          "description": "Message name or ID.",
          "required": true
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        }
      }
    },
    "search_messages": {
      "description": "Bounded message search in one space.",
      "properties": {
        "space": {
          "type": "string",
          "description": "Space name or ID.",
          "required": true
        },
        "query": {
          "type": "string",
          "description": "Search text.",
          "required": true
        },
        "filter": {
          "type": "string",
          "description": "Optional list filter.",
          "required": false
        },
        "order_by": {
          "type": "string",
          "description": "Scan sort order.",
          "required": false,
          "enum": [
            "create_time DESC",
            "create_time ASC",
            "createTime DESC",
            "createTime ASC"
          ]
        },
        "show_deleted": {
          "type": "boolean",
          "description": "Include deleted messages.",
          "required": false
        },
        "page_size": {
          "type": "integer",
          "description": "Scan page size.",
          "required": false
        },
        "max_results": {
          "type": "integer",
          "description": "Max matches.",
          "required": false
        },
        "scan_limit": {
          "type": "integer",
          "description": "Max messages scanned.",
          "required": false
        },
        "case_sensitive": {
          "type": "boolean",
          "description": "Case-sensitive match.",
          "required": false
        },
        "search_fields": {
          "type": "array",
          "description": "Fields to search.",
          "required": false,
          "items": {
            "type": "string",
            "enum": [
              "text",
              "formatted_text",
              "argument_text",
              "sender",
              "attachment_name"
            ]
          }
        }
      }
    },
    "create_message": {
      "description": "Create a message, optionally with files.",
      "properties": {
        "space": {
          "type": "string",
          "description": "Target space.",
          "required": true
        },
        "text": {
          "type": "string",
          "description": "Message text.",
          "required": false
        },
        "cards_v2": {
          "type": "array",
          "description": "Cards v2 payload.",
          "required": false,
          "items": {
            "type": "object"
          }
        },
        "thread_name": {
          "type": "string",
          "description": "Thread name.",
          "required": false
        },
        "thread_key": {
          "type": "string",
          "description": "Thread key.",
          "required": false
        },
        "message_reply_option": {
          "type": "string",
          "description": "Reply option.",
          "required": false,
          "enum": [
            "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD",
            "REPLY_MESSAGE_OR_FAIL"
          ]
        },
        "message_request_id": {
          "type": "string",
          "description": "Idempotency requestId.",
          "required": false
        },
        "message_id": {
          "type": "string",
          "description": "Client message ID.",
          "required": false
        },
        "notification_type": {
          "type": "string",
          "description": "Notification type.",
          "required": false,
          "enum": [
            "NOTIFICATION_TYPE_NONE",
            "NOTIFICATION_TYPE_FORCE_NOTIFY",
            "NOTIFICATION_TYPE_SILENT"
          ]
        },
        "file_ids": {
          "type": "array",
          "description": "File Manager IDs to attach.",
          "required": false,
          "items": {
            "type": "string"
          }
        },
        "max_upload_bytes": {
          "type": "integer",
          "description": "Max upload bytes.",
          "required": false
        }
      }
    },
    "reply_message": {
      "description": "Reply to a message, optionally with files.",
      "properties": {
        "message_name": {
          "type": "string",
          "description": "Message name or ID.",
          "required": true
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        },
        "text": {
          "type": "string",
          "description": "Reply text.",
          "required": false
        },
        "cards_v2": {
          "type": "array",
          "description": "Cards v2 payload.",
          "required": false,
          "items": {
            "type": "object"
          }
        },
        "message_reply_option": {
          "type": "string",
          "description": "Reply option.",
          "required": false,
          "enum": [
            "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD",
            "REPLY_MESSAGE_OR_FAIL"
          ]
        },
        "message_request_id": {
          "type": "string",
          "description": "Idempotency requestId.",
          "required": false
        },
        "message_id": {
          "type": "string",
          "description": "Client message ID.",
          "required": false
        },
        "notification_type": {
          "type": "string",
          "description": "Notification type.",
          "required": false,
          "enum": [
            "NOTIFICATION_TYPE_NONE",
            "NOTIFICATION_TYPE_FORCE_NOTIFY",
            "NOTIFICATION_TYPE_SILENT"
          ]
        },
        "file_ids": {
          "type": "array",
          "description": "File Manager IDs to attach.",
          "required": false,
          "items": {
            "type": "string"
          }
        },
        "max_upload_bytes": {
          "type": "integer",
          "description": "Max upload bytes.",
          "required": false
        }
      }
    },
    "update_message": {
      "description": "Update message text/cards.",
      "properties": {
        "message_name": {
          "type": "string",
          "description": "Message name or ID.",
          "required": true
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        },
        "text": {
          "type": "string",
          "description": "Updated text.",
          "required": false
        },
        "cards_v2": {
          "type": "array",
          "description": "Updated cards v2.",
          "required": false,
          "items": {
            "type": "object"
          }
        }
      }
    },
    "delete_message": {
      "description": "Delete a message.",
      "properties": {
        "message_name": {
          "type": "string",
          "description": "Message name or ID.",
          "required": true
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        },
        "force": {
          "type": "boolean",
          "description": "Delete replies too.",
          "required": false
        }
      }
    },
    "list_reactions": {
      "description": "List message reactions.",
      "properties": {
        "message_name": {
          "type": "string",
          "description": "Message name or ID.",
          "required": true
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        },
        "page_size": {
          "type": "integer",
          "description": "Page size.",
          "required": false
        },
        "page_token": {
          "type": "string",
          "description": "Next page token.",
          "required": false
        },
        "filter": {
          "type": "string",
          "description": "Reaction filter.",
          "required": false
        }
      }
    },
    "add_reaction": {
      "description": "Add a reaction.",
      "properties": {
        "message_name": {
          "type": "string",
          "description": "Message name or ID.",
          "required": true
        },
        "emoji_unicode": {
          "type": "string",
          "description": "Unicode emoji.",
          "required": true
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        }
      }
    },
    "delete_reaction": {
      "description": "Delete a reaction.",
      "properties": {
        "reaction_name": {
          "type": "string",
          "description": "Reaction name or ID.",
          "required": true
        },
        "message_name": {
          "type": "string",
          "description": "Message for short IDs.",
          "required": false
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        }
      }
    },
    "list_message_attachments": {
      "description": "List message attachments.",
      "properties": {
        "message_name": {
          "type": "string",
          "description": "Message name or ID.",
          "required": true
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        }
      }
    },
    "get_attachment": {
      "description": "Get attachment metadata from its message.",
      "properties": {
        "attachment_name": {
          "type": "string",
          "description": "Attachment name, ID, or contentName.",
          "required": true
        },
        "message_name": {
          "type": "string",
          "description": "Parent message.",
          "required": false
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        }
      }
    },
    "search_attachments": {
      "description": "Bounded attachment search in one space.",
      "properties": {
        "space": {
          "type": "string",
          "description": "Space name or ID.",
          "required": true
        },
        "query": {
          "type": "string",
          "description": "Search text.",
          "required": true
        },
        "filter": {
          "type": "string",
          "description": "Optional list filter.",
          "required": false
        },
        "order_by": {
          "type": "string",
          "description": "Scan sort order.",
          "required": false,
          "enum": [
            "create_time DESC",
            "create_time ASC",
            "createTime DESC",
            "createTime ASC"
          ]
        },
        "page_size": {
          "type": "integer",
          "description": "Scan page size.",
          "required": false
        },
        "max_results": {
          "type": "integer",
          "description": "Max matches.",
          "required": false
        },
        "scan_limit": {
          "type": "integer",
          "description": "Max messages scanned.",
          "required": false
        },
        "case_sensitive": {
          "type": "boolean",
          "description": "Case-sensitive match.",
          "required": false
        }
      }
    },
    "upload_attachment": {
      "description": "Upload a File Manager file to Chat.",
      "properties": {
        "space": {
          "type": "string",
          "description": "Target space.",
          "required": true
        },
        "source_file_id": {
          "type": "string",
          "description": "File Manager source ID.",
          "required": true
        },
        "filename": {
          "type": "string",
          "description": "Filename override.",
          "required": false
        },
        "content_type": {
          "type": "string",
          "description": "MIME type override.",
          "required": false
        },
        "max_upload_bytes": {
          "type": "integer",
          "description": "Max upload bytes.",
          "required": false
        }
      }
    },
    "download_attachment_to_storage": {
      "description": "Download Chat media to File Manager.",
      "properties": {
        "attachment_name": {
          "type": "string",
          "description": "Attachment name, ID, or contentName.",
          "required": false
        },
        "media_resource_name": {
          "type": "string",
          "description": "attachmentDataRef.resourceName.",
          "required": false
        },
        "message_name": {
          "type": "string",
          "description": "Parent message.",
          "required": false
        },
        "space": {
          "type": "string",
          "description": "Space for short IDs.",
          "required": false
        },
        "output_filename": {
          "type": "string",
          "description": "Stored filename.",
          "required": false
        },
        "expiration_days": {
          "type": "integer",
          "description": "Expiration days.",
          "required": false
        },
        "max_bytes": {
          "type": "integer",
          "description": "Max download bytes.",
          "required": false
        }
      }
    }
  }
}
```

### Usage Instructions

# Google Chat

Read spaces, list and search messages, send messages, react to messages, and move attachments between Google Chat and AgentPMT File Manager.

This tool uses the existing AgentPMT Google OAuth scopes only:

- `chat.spaces.readonly`
- `chat.messages`
- `chat.messages.reactions`

It does not manage members or users, does not create/update/delete spaces, does not use admin access, and does not expose custom emoji actions. Member listing requires `chat.memberships.readonly` or `chat.memberships`, which this connection does not currently have.

## Parameters

- `action` (string, required): Action to perform. Default: `get_instructions`
- `space` (string): Space name or ID, such as `"spaces/AAA"` or `"AAA"`
- `message_name` (string): Message resource name, or short message ID when `space` is provided
- `reaction_name` (string): Reaction resource name, or short reaction ID when `message_name` is provided
- `attachment_name` (string): Attachment resource name, short attachment ID, or attachment `contentName` when `message_name` is provided
- `media_resource_name` (string): Direct `attachmentDataRef.resourceName` for Chat media download
- `user_name` (string): User resource name, such as `"users/123"`
- `query` (string): Search query for space/message/attachment search actions
- `text` (string): Message text
- `cards_v2` (array): Cards v2 payload
- `thread_name` (string): Existing Chat thread resource name
- `thread_key` (string): Thread key for message creation
- `message_reply_option` (string): `REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD` or `REPLY_MESSAGE_OR_FAIL`
- `message_request_id` (string): Google Chat `requestId` for idempotent message creation
- `message_id` (string): Client-assigned Google Chat message ID
- `notification_type` (string): `NOTIFICATION_TYPE_NONE`, `NOTIFICATION_TYPE_FORCE_NOTIFY`, or `NOTIFICATION_TYPE_SILENT`
- `page_size` (integer, default 50): Max results per page. Reactions max is 200.
- `page_token` (string): Pagination token
- `filter` (string): Google Chat filter query
- `order_by` (string): Sort order
- `show_deleted` (boolean, default false): Include deleted messages in message list/search
- `max_results` (integer, default 25): Max client-side search matches
- `scan_limit` (integer, default 500): Max messages scanned by bounded client-side search
- `case_sensitive` (boolean, default false): Use case-sensitive client-side search
- `search_fields` (array): Fields searched by `search_messages`: `text`, `formatted_text`, `argument_text`, `sender`, `attachment_name`
- `emoji_unicode` (string): Unicode emoji for `add_reaction`
- `force` (boolean, default false): For `delete_message`, also delete threaded replies
- `file_ids` (array): AgentPMT File Manager file IDs to upload and attach to `create_message` or `reply_message`
- `source_file_id` (string): AgentPMT File Manager file ID for `upload_attachment`
- `filename` (string): Optional upload filename override
- `content_type` (string): Optional upload MIME type override
- `max_upload_bytes` (integer, default 26214400): Max File Manager bytes uploaded to Chat
- `max_bytes` (integer, default 26214400): Max Chat attachment bytes downloaded
- `output_filename` (string): File Manager filename for downloaded attachment
- `expiration_days` (integer, default 7): Stored download expiration, 1-7 days

## Sorting

`list_messages` sends `order_by: "create_time DESC"` by default, so messages are newest first. Send `order_by: "create_time ASC"` for oldest first.

Google also accepts legacy camel-case sort aliases from this tool:

```json
{"action":"list_messages","space":"spaces/AAA","order_by":"createTime DESC"}
```

The tool normalizes that to official Google Chat syntax.

## Search

`search_spaces` is Google server-side search. Non-admin Google Chat search needs a display-name query for useful results:

```json
{"action":"search_spaces","query":"display_name:\"Launch\"","order_by":"relevance DESC"}
```

`search_messages` and `search_attachments` are bounded client-side searches within one space. They page through accessible messages using `list_messages`, scan up to `scan_limit`, and return `scan_limit_reached` when the scan stopped before the space was exhausted. These are not global Google-side full-text search endpoints.

## File Upload

Preferred path: attach File Manager files directly when creating or replying to a message.

```json
{
  "action": "create_message",
  "space": "spaces/AAA",
  "text": "Attached is the latest report.",
  "file_ids": ["file-manager-id-1"]
}
```

Advanced path: use `upload_attachment` to stage a File Manager file in Chat and return an `attachment_data_ref`.

```json
{"action":"upload_attachment","space":"spaces/AAA","source_file_id":"file-manager-id-1"}
```

File uploads require normal authenticated budget context. Admin bypass cannot read budget-scoped File Manager files.

## File Download

List attachments on a message:

```json
{"action":"list_message_attachments","message_name":"spaces/AAA/messages/BBB"}
```

Download an attachment into AgentPMT File Manager:

```json
{
  "action": "download_attachment_to_storage",
  "message_name": "spaces/AAA/messages/BBB",
  "attachment_name": "spaces/AAA/messages/BBB/attachments/ATT",
  "output_filename": "report.pdf"
}
```

If you already have `attachment.attachmentDataRef.resourceName`, you can download directly:

```json
{
  "action": "download_attachment_to_storage",
  "media_resource_name": "spaces/AAA/messages/BBB/attachments/ATT/media",
  "output_filename": "report.pdf"
}
```

`get_attachment` reads the parent message and finds the attachment in message data. It does not call the bot-only `spaces.messages.attachments.get` endpoint.

## Actions

### `get_instructions`

Returns this documentation.

```json
{"action":"get_instructions"}
```

### `list_spaces`

Lists spaces the authenticated user has access to.

Required: none
Optional: `page_size`, `page_token`, `filter`

```json
{"action":"list_spaces","page_size":25}
```

```json
{"action":"list_spaces","filter":"space_type = \"SPACE\""}
```

### `get_space`

Gets a space by resource name or short ID.

Required: `space`

```json
{"action":"get_space","space":"spaces/AAA"}
```

### `search_spaces`

Searches accessible spaces with Google Chat server-side space search. Admin access is not exposed.

Required: `query`
Optional: `page_size`, `page_token`, `order_by`

```json
{"action":"search_spaces","query":"display_name:\"Launch\"","order_by":"relevance DESC"}
```

### `find_direct_message`

Finds the direct message space with a user.

Required: `user_name`

```json
{"action":"find_direct_message","user_name":"users/123456789"}
```

### `list_messages`

Lists messages in a space. Defaults to newest first.

Required: `space`
Optional: `page_size`, `page_token`, `filter`, `order_by`, `show_deleted`

```json
{"action":"list_messages","space":"spaces/AAA","page_size":20}
```

```json
{
  "action": "list_messages",
  "space": "spaces/AAA",
  "filter": "create_time > \"2026-01-01T00:00:00Z\"",
  "order_by": "create_time ASC"
}
```

### `get_message`

Gets a message by resource name or by short message ID with `space`.

Required: `message_name`
Optional: `space`

```json
{"action":"get_message","message_name":"spaces/AAA/messages/BBB"}
```

### `search_messages`

Bounded client-side search within one space.

Required: `space`, `query`
Optional: `filter`, `order_by`, `show_deleted`, `page_size`, `max_results`, `scan_limit`, `case_sensitive`, `search_fields`

```json
{"action":"search_messages","space":"spaces/AAA","query":"invoice","max_results":10,"scan_limit":500}
```

```json
{
  "action": "search_messages",
  "space": "spaces/AAA",
  "query": "Taylor",
  "search_fields": ["sender"],
  "order_by": "create_time DESC"
}
```

### `create_message`

Sends a new message to a space. At least one of `text`, `cards_v2`, or `file_ids` is required.

Required: `space`, plus one content field
Optional: `thread_name`, `thread_key`, `message_reply_option`, `message_request_id`, `message_id`, `notification_type`, `file_ids`, `max_upload_bytes`

```json
{"action":"create_message","space":"spaces/AAA","text":"Hello from the agent."}
```

```json
{
  "action": "create_message",
  "space": "spaces/AAA",
  "text": "Here is the file.",
  "file_ids": ["file-manager-id-1"]
}
```

### `reply_message`

Replies in the original message's thread. At least one of `text`, `cards_v2`, or `file_ids` is required.

Required: `message_name`, plus one content field
Optional: `space`, `message_reply_option`, `message_request_id`, `message_id`, `notification_type`, `file_ids`, `max_upload_bytes`

```json
{"action":"reply_message","message_name":"spaces/AAA/messages/BBB","text":"Got it."}
```

```json
{
  "action": "reply_message",
  "message_name": "spaces/AAA/messages/BBB",
  "text": "Attached.",
  "file_ids": ["file-manager-id-1"]
}
```

### `update_message`

Edits an existing message. Only `text` and `cards_v2` updates are exposed.

Required: `message_name`, plus one of `text` or `cards_v2`
Optional: `space`

```json
{"action":"update_message","message_name":"spaces/AAA/messages/BBB","text":"Updated text"}
```

### `delete_message`

Deletes a message.

Required: `message_name`
Optional: `space`, `force`

```json
{"action":"delete_message","message_name":"spaces/AAA/messages/BBB"}
```

```json
{"action":"delete_message","message_name":"spaces/AAA/messages/BBB","force":true}
```

### `list_reactions`

Lists reactions on a message. `page_size` must be 200 or less.

Required: `message_name`
Optional: `space`, `page_size`, `page_token`, `filter`

```json
{"action":"list_reactions","message_name":"spaces/AAA/messages/BBB"}
```

```json
{"action":"list_reactions","message_name":"spaces/AAA/messages/BBB","filter":"emoji.unicode = \"\\uD83D\\uDE42\""}
```

### `add_reaction`

Adds an emoji reaction to a message.

Required: `message_name`, `emoji_unicode`
Optional: `space`

```json
{"action":"add_reaction","message_name":"spaces/AAA/messages/BBB","emoji_unicode":"\\uD83D\\uDC4D"}
```

### `delete_reaction`

Deletes a reaction.

Required: `reaction_name`
Optional: `message_name`, `space`

```json
{"action":"delete_reaction","reaction_name":"spaces/AAA/messages/BBB/reactions/RRR"}
```

### `list_message_attachments`

Lists attachments in a message.

Required: `message_name`
Optional: `space`

```json
{"action":"list_message_attachments","message_name":"spaces/AAA/messages/BBB"}
```

### `get_attachment`

Gets attachment metadata from the parent message payload.

Required: `attachment_name`
Optional: `message_name`, `space`

```json
{
  "action": "get_attachment",
  "message_name": "spaces/AAA/messages/BBB",
  "attachment_name": "report.pdf"
}
```

```json
{"action":"get_attachment","attachment_name":"spaces/AAA/messages/BBB/attachments/ATT"}
```

### `search_attachments`

Bounded client-side attachment search within one space.

Required: `space`, `query`
Optional: `filter`, `order_by`, `page_size`, `max_results`, `scan_limit`, `case_sensitive`

```json
{"action":"search_attachments","space":"spaces/AAA","query":"report","max_results":10}
```

### `upload_attachment`

Uploads a File Manager file into Chat and returns an `attachment_data_ref`. Most workflows should use `create_message` or `reply_message` with `file_ids` instead.

Required: `space`, `source_file_id`
Optional: `filename`, `content_type`, `max_upload_bytes`

```json
{"action":"upload_attachment","space":"spaces/AAA","source_file_id":"file-manager-id-1"}
```

### `download_attachment_to_storage`

Downloads a Chat attachment into AgentPMT File Manager.

Required: `media_resource_name` or `attachment_name`
Optional: `message_name`, `space`, `output_filename`, `expiration_days`, `max_bytes`

```json
{
  "action": "download_attachment_to_storage",
  "message_name": "spaces/AAA/messages/BBB",
  "attachment_name": "report.pdf",
  "output_filename": "report.pdf"
}
```

```json
{
  "action": "download_attachment_to_storage",
  "media_resource_name": "spaces/AAA/messages/BBB/attachments/ATT/media",
  "output_filename": "report.pdf"
}
```

## Response

All successful responses return `{"success": true, "output": { ... }}` from the tool route. Output varies by action:

- `list_spaces` -> `{"spaces": [...], "next_page_token": "..."}`
- `get_space` -> `{"space": {...}}`
- `search_spaces` -> `{"spaces": [...], "next_page_token": "...", "query": "..."}`
- `find_direct_message` -> `{"space": {...}, "user_name": "..."}`
- `list_messages` -> `{"messages": [...], "next_page_token": "...", "order_by": "create_time DESC"}`
- `get_message` -> `{"message": {...}}`
- `search_messages` -> `{"messages": [...], "matched_count": 0, "scanned_count": 0, "scan_limit_reached": false}`
- `create_message` / `reply_message` -> `{"message": {...}, "uploaded_attachments": [...]}`
- `update_message` -> `{"message": {...}}`
- `delete_message` / `delete_reaction` -> `{"deleted": true, "name": "..."}`
- `list_reactions` -> `{"reactions": [...], "next_page_token": "..."}`
- `add_reaction` -> `{"reaction": {...}}`
- `list_message_attachments` -> `{"attachments": [...], "count": 0}`
- `get_attachment` -> `{"attachment": {...}, "message_name": "..."}`
- `search_attachments` -> `{"attachments": [...], "matched_count": 0, "scanned_messages": 0}`
- `upload_attachment` -> `{"attachment_data_ref": {...}, "source_file": {...}}`
- `download_attachment_to_storage` -> `{"attachment": {...}, "download": {"stored_as": {...}, "content_type": "...", "size_bytes": 0}}`

## Resource Name Formats

- Space: `spaces/AAA`
- Message: `spaces/AAA/messages/BBB`
- Thread: `spaces/AAA/threads/CCC`
- Reaction: `spaces/AAA/messages/BBB/reactions/RRR`
- Attachment: `spaces/AAA/messages/BBB/attachments/ATT`
- User: `users/123`

Short IDs are accepted only when paired with the parent resource (`space` or `message_name`).

### Frequently Asked Questions

#### How do I connect this tool to an external agent?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

#### How does an external agent use this tool?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

After the external agent is connected to an Agent Group that can use this tool, paste this prompt into the agent:

> Use the AgentPMT-Tool-Search-and-Execution tool. First call action 'get\_instructions' so you know how to use the tool search interface. Then call action 'get\_schema' with tool\_id 6968000436a6023a803ab753 ("Google Chat"). After reading the schema and any returned instructions, tell me what this tool can do, we are going to be using it

The agent should fetch the tool schema first, collect the required parameters for your request, and then call the tool through AgentPMT.

### Dependencies

This product has no public dependency products.