# create_invite

> 這個 AirBuild MCP 工具會建立一個連結，打開它的人可以成員身分加入團隊，可設定有效期限和使用次數上限。僅限擁有者。

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

`create_invite` 會建立邀請連結：任何已登入 AirBuild 的人打開它，都能以成員身分加入團隊。它不會把連結傳給任何人：請把它交給你想邀請的人。連結在過期、用完或以 [revoke_invite](https://air.build/tw/docs/mcp-tools/revoke_invite/) 撤銷之前都有效。只有團隊擁有者能建立邀請連結；成員呼叫會失敗。每次呼叫都會建立新連結。另請參閱 [邀請他人加入團隊](https://air.build/tw/docs/team/invite-people/)。

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

## 輸入

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | 是 | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/) |
| `expiresInSeconds` | integer | 否 | 7 天（`604800`） | 連結的有效時間。小於 60 時以 60 計；超過 30 天（`2592000`）時以 30 天計 |
| `maxUses` | 整數，至少為 1 | 否 | unlimited | 最多可以有多少人透過該連結加入。省略表示不限：`0` 會被拒絕 |

## 結果

| 欄位 | 說明 |
| --- | --- |
| `inviteId` | 邀請的 ID（UUID），供 [revoke_invite](https://air.build/tw/docs/mcp-tools/revoke_invite/) 使用 |
| `link` | 要交給他人的連結：`https://<site>/join/<code>` |
| `expiresAt` | 連結失效的時間（ISO 8601） |
| `maxUses` | 最多可以有多少人透過它加入，`null` 表示不限 |

```json
{
  "inviteId": "00000000-0000-0000-0000-000000000000",
  "link": "https://<site>/join/<code>",
  "expiresAt": "2026-11-27T09:30:00Z",
  "maxUses": 5
}
```

## 錯誤

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| Only the Team's owner can invite people. | 你是這個團隊的成員，而不是擁有者 | 向擁有者索取連結 |
| maxUses must be at least 1. | `maxUses` 為 `0` | 省略 `maxUses` 表示不限，或填入 1 以上的數字 |
| 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_invite", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "expiresInSeconds": 86400, "maxUses": 5}}
```
