# appstore_invite_testers

> 透過電子郵件邀請人加入 TestFlight 群組，並查看每個地址是已邀請、已加入還是遭拒絕。

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

透過電子郵件把人加入 TestFlight 群組。群組有建置版本後，Apple 會寄邀請郵件給每個人。已經在其他地方是該 App 測試人員的人，會以原本的身分加入這個群組。內部群組只接受該 Apple 團隊自己的 App Store Connect 使用者；Apple 會拒絕其他人。

每個人都會個別處理，結果會說明每個人的情況。有一個例外：如果 Apple 拒絕加入某個已經是該 App 測試人員的人，整個呼叫會失敗，但清單中排在前面的人已經受到邀請。

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

## 輸入

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | yes | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/)。 |
| `projectId` | 字串（UUID） | 與 `appId` 二擇一 | — | 這個 App 所屬的專案，來自 [list_projects](https://air.build/tw/docs/mcp-tools/list_projects/)：這是指定 App 的一般方式。App 是 App Store Connect 上 bundle ID 與該專案建置的 bundle ID 相同的那一個。兩者都傳送時，會使用 `projectId`。 |
| `appId` | string | 與 `projectId` 二擇一 | — | 來自 [appstore_list_apps](https://air.build/tw/docs/mcp-tools/appstore_list_apps/) 的 App Store Connect App ID，用於沒有專案建置的 App。 |
| `appleTeamId` | 字串（UUID） | no | 所有已連結的 Apple 團隊 | 團隊的其中一個 Apple 團隊，來自 [appstore_list_apple_teams](https://air.build/tw/docs/mcp-tools/appstore_list_apple_teams/)。搭配 `appId` 時，只會在這個 Apple 團隊中尋找該 App。搭配 `projectId` 時不需要：由專案的 App 決定。 |
| `group` | string | yes | — | 群組的名稱或 `groupId`，來自 [appstore_list_beta_groups](https://air.build/tw/docs/mcp-tools/appstore_list_beta_groups/)。 |
| `testers` | 包含 1 到 50 個物件的陣列 | yes | — | 要加入的人。 |
| `testers[].email` | 字串（電子郵件） | yes | — | 對方的電子郵件地址。 |
| `testers[].firstName` | string | no | — | 對方的名字。 |
| `testers[].lastName` | string | no | — | 對方的姓氏。 |

每個工具對輸入進行的檢查，請參閱 [伺服器與登入](https://air.build/tw/docs/mcp-tools/server/#errors)。

## 結果

一個 JSON 物件，同時以文字和 `structuredContent` 傳回。

| 欄位 | 說明 |
| --- | --- |
| `group` | 群組（欄位同 [appstore_list_beta_groups](https://air.build/tw/docs/mcp-tools/appstore_list_beta_groups/#result)） |
| `testers[].email` | 傳送的地址 |
| `testers[].result` | `invited`（新測試人員）、`added`（既有測試人員被加入該群組），或 Apple 拒絕此人時給出的句子 |

```json
{
  "group": {
    "groupId": "00000000-0000-0000-0000-000000000000",
    "name": "Friends",
    "kind": "external",
    "allBuilds": false,
    "publicLink": "https://testflight.apple.com/join/XXXXXXXX",
    "publicLinkLimit": 100,
    "feedback": true
  },
  "testers": [
    {
      "email": "tester@example.com",
      "result": "invited"
    },
    {
      "email": "friend@example.com",
      "result": "added"
    }
  ]
}
```

## 錯誤

每個錯誤都會以工具錯誤（`isError: true`）傳回。_斜體_ 文字代表句中的實際值。所有工具都可能傳回的錯誤，請參閱 [伺服器與登入](https://air.build/tw/docs/mcp-tools/server/#errors)。

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| testers must list at least one email. | `testers` 為空或不是清單 | 至少傳送一位測試人員 |
| No TestFlight group "_group_". The app's groups: _names_. | App 沒有任何群組的名稱（不分大小寫）或 `groupId` 與之相符。沒有任何群組時，清單會顯示「none — create one with appstore_create_beta_group」 | 使用句中或 [appstore_list_beta_groups](https://air.build/tw/docs/mcp-tools/appstore_list_beta_groups/) 中的名稱 |
| Pass projectId, or appId from appstore_list_apps. | `projectId` 和 `appId` 都沒有傳送 | 傳送其中一個 |
| This Project has not been built for iOS yet, so it has no bundle id to find its app by. Ask the Team's Agent to build it, or pass appId. | 該專案從未建置過 iOS 版本 | 請專案的 Agent 建置 iOS 版本（[send_message](https://air.build/tw/docs/mcp-tools/send_message/)），或用 `appId` 指定 App |
| This Project has no app on App Store Connect yet. Create one with appstore_create_app (its bundle id is the Project's), or pass appId. | 團隊已連結的 Apple 團隊中，沒有 App 的 bundle ID 與專案相同，或沒有連結任何 Apple 團隊 | 用 [appstore_create_app](https://air.build/tw/docs/mcp-tools/appstore_create_app/) 建立 App，或用 `appId` 指定另一個 App |
| No connected Apple team of this Team has that app. See appstore_list_apps. | `appId` 不是任何已連結 Apple 團隊（或 `appleTeamId`）中的 App | 從 [appstore_list_apps](https://air.build/tw/docs/mcp-tools/appstore_list_apps/) 取得 ID |
| App Store Connect: _Apple's sentence_ | Apple 拒絕了請求。後面最多附上 Apple 自己的五句說明，Apple 指出相關欄位時會在括號中註明。App Store Connect 中有待接受的 Apple 協議時，也會以這種方式被拒絕 | 依照 Apple 的說明處理。協議由 Apple Developer 帳號的帳號持有人在 App Store Connect 中接受（商務 › 協議） |
| App Store Connect answered _status_. Try again in a moment. | Apple 拒絕了，但沒有說明原因 | 稍後再試 |

## 範例

```json
{
  "name": "appstore_invite_testers",
  "arguments": {
    "teamId": "00000000-0000-0000-0000-000000000000",
    "projectId": "00000000-0000-0000-0000-000000000000",
    "group": "Friends",
    "testers": [
      {
        "email": "tester@example.com",
        "firstName": "Alex"
      }
    ]
  }
}
```
