# remove_channel_member

> 這個 AirBuild MCP 工具會把一個人或 Agent 移出專案聊天或群組聊天，或把你自己移出以離開聊天。

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

`remove_channel_member` 會把一個人或一個 Agent 移出專案聊天或群組聊天。填入你自己即可離開。把 Agent 移出專案的聊天，就是讓它離開該專案；它仍會留在團隊及其其他聊天中（若要把它從團隊中移除，請使用 [remove_agent](https://air.build/tw/docs/mcp-tools/remove_agent/)）。專案至少保留一個已開啟的 Agent。聊天中會顯示誰被移除或離開了；他們之前的訊息會保留。不在其中的人會維持原狀，不會出錯。私訊無法變更。團隊中的任何人都可以呼叫。

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

## 輸入

`userId` 和 `agentId` 必須剛好提供一個。

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | 是 | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/) |
| `channelId` | string | 是 | — | 專案聊天（`proj.<uuid>`）或群組聊天（`grp.<uuid>`），來自 [list_channels](https://air.build/tw/docs/mcp-tools/list_channels/) |
| `userId` | 字串（UUID） | 兩者之一 | — | 要移出的人，來自 [list_members](https://air.build/tw/docs/mcp-tools/list_members/) |
| `agentId` | string | 兩者之一 | — | 要移出的 Agent，來自 [list_members](https://air.build/tw/docs/mcp-tools/list_members/) |

## 結果

| 欄位 | 說明 |
| --- | --- |
| `removed` | `true` |

```json
{ "removed": true }
```

## 錯誤

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| Each member names exactly one of userId or agentId. | 兩者都沒傳送，或兩者都傳送了 | 傳送其中一個 |
| A project needs at least one active agent. Keep one selected. | 這是專案聊天中最後一個已開啟的 Agent | 先用 [add_channel_members](https://air.build/tw/docs/mcp-tools/add_channel_members/) 加入另一個 Agent |
| A direct message's members cannot be changed. | `channelId` 是私訊頻道 | 私訊始終保留兩位成員 |
| Member not found. | 這個人或 Agent 不在這個團隊中 | 從 [list_members](https://air.build/tw/docs/mcp-tools/list_members/) 取得 |
| 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": "remove_channel_member", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "channelId": "grp.00000000-0000-0000-0000-000000000000", "agentId": "designer"}}
```
