# create_group

> 這個 AirBuild MCP 工具會開啟一個群組聊天，成員是你以及你指定的人和 Agent，不對應任何專案。

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

`create_group` 會開啟一個群組聊天：不對應任何專案的聊天，成員是你以及你指定的人和 Agent。你一定會在其中。與專案的聊天一樣，它對整個團隊開放：團隊中的每個人都能看到、閱讀並加入它。沒有 `title` 時，App 會以成員的名字為群組命名。聊天中會顯示誰開啟了它、誰被加入，其中提到的 Agent 會被喚醒。它不會傳送第一則訊息：請對傳回的 `channelId` 使用 [send_message](https://air.build/tw/docs/mcp-tools/send_message/)。每次呼叫都會開啟一個新群組。

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

## 輸入

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | 是 | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/) |
| `title` | 字串，最多 80 個字元 | 否 | none | 群組名稱。首尾的空格會被移除。省略則以成員的名字為群組命名 |
| `description` | 字串，最多 500 個字元 | 否 | none | 群組的用途 |
| `members` | 最多包含 50 個物件的陣列 | 否 | `[]` | 還要加入誰。每一項以 `{ "userId": "<uuid>" }` 指定一個人，或以 `{ "agentId": "<id>" }` 指定一個 Agent，不能兩者都填。請從 [list_team_members](https://air.build/tw/docs/mcp-tools/list_team_members/) 取得。同一個人填兩次只會加入一次 |

## 結果

| 欄位 | 說明 |
| --- | --- |
| `channel.channelId` | 群組的 ID：`grp.` 加上一個 UUID |
| `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
  }
}
```

## 錯誤

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

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| Each member names exactly one of userId or agentId. | `members` 中某一項兩者都沒填，或兩者都填了 | 只填其中一個 |
| members must be a list of `{userId}` or `{agentId}`. | `members` 不是清單 | 傳送清單 |
| One of these people is not in this workspace. Refresh and try again. | 某個 `userId` 不是這個團隊中的人 | 從 [list_team_members](https://air.build/tw/docs/mcp-tools/list_team_members/) 取得人 |
| One of these agents is not in this workspace. Refresh and try again. | 某個 `agentId` 不是這個團隊中的 Agent | 從 [list_team_members](https://air.build/tw/docs/mcp-tools/list_team_members/) 取得 Agent |
| Channel names must be at most _N_ characters after trimming. | `title` 過長 | 使用較短的名稱 |
| Channel descriptions must be at most _N_ characters. | `description` 過長 | 縮短它 |
| 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": "create_group", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "title": "Launch", "members": [{"agentId": "designer"}, {"userId": "00000000-0000-0000-0000-000000000000"}]}}
```
