# update_group

> 這個 AirBuild MCP 工具會重新命名群組聊天或變更其描述。

Source: https://air.build/tw/docs/mcp-tools/update_group/

`update_group` 會重新命名群組聊天、變更其描述，或兩者都變更。只傳送要變更的內容：省略的欄位維持原樣。空的 `title` 會清除名稱，App 會重新用成員的名字為群組命名。新名稱會在聊天中公告；描述的變更則不會。它只適用於群組聊天：專案的聊天使用專案的名稱（請使用 [rename_project](https://air.build/tw/docs/mcp-tools/rename_project/)），私訊沒有可以變更的名稱。它的圖片用 [start_picture_upload](https://air.build/tw/docs/mcp-tools/start_picture_upload/) 設定。團隊中的任何人都可以呼叫。

| 唯讀 | 破壞性 | 冪等 |
| --- | --- | --- |
| 否 | 否 | 是 |

## 輸入

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | 是 | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/) |
| `channelId` | string | 是 | — | 群組，`grp.<uuid>`，來自 [list_channels](https://air.build/tw/docs/mcp-tools/list_channels/) |
| `title` | 字串，最多 80 個字元 | 否 | unchanged | 新名稱；`""` 會清除它。兩端的空格會被去除 |
| `description` | 字串，最多 500 個字元 | 否 | unchanged | 新描述；`""` 會清除它 |

## 結果

| 欄位 | 說明 |
| --- | --- |
| `channel.channelId` | 群組的 ID |
| `channel.kind` | `group` |
| `channel.title` | 所有人看到的名稱：新的 `title`，沒有時為成員的名字 |
| `channel.description` | 描述 |
| `channel.projectId` | `null` |

```json
{
  "channel": {
    "channelId": "grp.00000000-0000-0000-0000-000000000000",
    "kind": "group",
    "title": "Notes",
    "description": "Launch plans",
    "projectId": null
  }
}
```

## 錯誤

_斜體_ 文字代表句中的實際值。

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| This is a project's channel: rename or delete the project instead. | `channelId` 是專案的聊天 | 使用 [rename_project](https://air.build/tw/docs/mcp-tools/rename_project/) |
| A direct message cannot be renamed or deleted. | `channelId` 是私訊頻道 | 只有群組可以設定名稱 |
| This group is archived. Unarchive it to rename it. | 群組已封存，且要變更 `title` | 請對方在 App 中取消封存 |
| This group is archived. Unarchive it to edit it. | 群組已封存，且只變更 `description` | 請對方在 App 中取消封存 |
| Channel names must be at most _N_ characters after trimming. | `title` 過長 | 使用較短的名稱 |
| Channel descriptions must be at most _N_ characters. | `description` 過長 | 縮短它 |
| Channel not found. | 這個團隊中沒有該頻道，或你看不到它 | 使用 [list_channels](https://air.build/tw/docs/mcp-tools/list_channels/) 傳回的 `channelId` |
| Team not found. | 團隊不存在，或你不在其中 | 使用 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/) 傳回的 `teamId` |

所有工具都可能傳回的錯誤，請參閱 [伺服器與登入](https://air.build/tw/docs/mcp-tools/server/#errors)。

## 範例

```json
{"name": "update_group", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "channelId": "grp.00000000-0000-0000-0000-000000000000", "title": "Launch", "description": "Launch plans"}}
```
