# appstore_list_apple_teams

> 列出團隊使用的 Apple Developer 團隊，以及每個團隊是否已連結、能否簽署建置版本、Apple 登入是否有效。

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

列出團隊使用的 Apple Developer 團隊。所有 App Store 工具都以團隊擁有者在 AirBuild 中連結的 Apple Developer 帳號運作（請參閱 [連結你的 Apple 開發者帳號](https://air.build/tw/docs/app-store/connect-apple-developer-account/)）：團隊的任何成員都可以使用，操作的是擁有者的 Apple 團隊。請先呼叫這個工具，確認是否有可操作的內容。它不會變更任何內容，也無法連結 Apple 帳號：只有團隊擁有者能在 AirBuild App 中連結。

Apple 這邊尚未就緒時會如何：

- **沒有連結 Apple 帳號，或沒有開啟任何 Apple 團隊。** `appleTeams` 為空，或沒有任何一項為 `connected: true`。此時其他 App Store 工具會以一句要求聯絡團隊擁有者的話拒絕（請參閱 [錯誤](https://air.build/tw/docs/mcp-tools/appstore_list_apple_teams/#errors)）。
- **擁有者的 Apple 登入已失效。** `signIn` 為 `session_expired` 或 `reauth_required`。大多數 App Store 工具仍可使用。需要擁有者登入的工具（[appstore_create_app](https://air.build/tw/docs/mcp-tools/appstore_create_app/)、[appstore_review](https://air.build/tw/docs/mcp-tools/appstore_review/) 的訊息、[appstore_reply_review](https://air.build/tw/docs/mcp-tools/appstore_reply_review/)、[appstore_request_expedited_review](https://air.build/tw/docs/mcp-tools/appstore_request_expedited_review/)、[appstore_privacy](https://air.build/tw/docs/mcp-tools/appstore_privacy/)、[appstore_update_privacy](https://air.build/tw/docs/mcp-tools/appstore_update_privacy/)，以及第一次使用的 [appstore_sales](https://air.build/tw/docs/mcp-tools/appstore_sales/)）在 AirBuild 無法自行續期時，會回應擁有者必須重新登入。只有擁有者能在 AirBuild App 中完成。

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

## 輸入

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | yes | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/)。 |

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

## 結果

一個 JSON 物件，同時以文字和 `structuredContent` 傳回。`appleTeams` 中每個 Apple 團隊一項：

| 欄位 | 說明 |
| --- | --- |
| `appleTeamId` | 其他 App Store 工具作為 `appleTeamId` 接受的 ID |
| `name` | Apple 團隊的名稱 |
| `developerTeamId` | Apple 的 10 字元團隊 ID，或 null |
| `connected` | App Store 工具能否使用這個 Apple 團隊 |
| `canSign` | 團隊的 Agent 目前能否用它簽署建置版本 |
| `signIn` | 擁有者的 Apple 登入：`active`、`session_expired`（AirBuild 可能仍能自行續期）或 `reauth_required`（只有擁有者能重新登入） |
| `salesReports` | Apple 是否已為這個 Apple 團隊指派廠商編號，銷售報告需要它（請參閱 [appstore_sales](https://air.build/tw/docs/mcp-tools/appstore_sales/)） |

```json
{
  "appleTeams": [
    {
      "appleTeamId": "00000000-0000-0000-0000-000000000000",
      "name": "Example Inc.",
      "developerTeamId": "ABCDE12345",
      "connected": true,
      "canSign": true,
      "signIn": "active",
      "salesReports": true
    }
  ]
}
```

## 錯誤

除了 [伺服器與登入](https://air.build/tw/docs/mcp-tools/server/#errors) 中的錯誤，這個工具沒有自己的錯誤。以下句子是團隊的 Apple 這邊尚未就緒時其他 App Store 工具給出的；每個工具的頁面都列出了它可能傳回的句子。

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| This Team has no Apple Developer account connected. The Team's owner connects one in AirBuild (Settings → Apple Developer). | 團隊擁有者沒有連結任何 Apple 開發者帳號 | 請團隊擁有者連結一個（在 App 中：**設定** › **開發者**） |
| None of this Team's Apple teams is connected yet. The Team's owner finishes connecting it in AirBuild. | 擁有者有 Apple 團隊，但沒有任何一個已開啟並就緒 | 請團隊擁有者完成連結 |
| This Team works with several Apple teams; pass appleTeamId: _name_ = _id_, …. | 連結了多個 Apple 團隊，但沒有傳送 `appleTeamId` | 傳送 `appleTeamId`，從句中列出的 ID 擇一 |
| That Apple team is not one of this Team's. See appstore_list_apple_teams. | `appleTeamId` 不是該團隊的 Apple 團隊 | 從 [appstore_list_apple_teams](https://air.build/tw/docs/mcp-tools/appstore_list_apple_teams/) 取得 |
| The Team owner's Apple sign-in has lapsed and only they can renew it: ask them to open AirBuild and sign in to Apple again, then try once more. | 團隊擁有者在 AirBuild 中的 Apple 登入已過期，沒有擁有者參與 AirBuild 無法續期 | 告知團隊擁有者，請對方在 AirBuild 中重新登入（請參閱 [連結你的 Apple 開發者帳號](https://air.build/tw/docs/app-store/connect-apple-developer-account/)）。在此之前重試會得到同樣的回應 |

## 範例

```json
{
  "name": "appstore_list_apple_teams",
  "arguments": {
    "teamId": "00000000-0000-0000-0000-000000000000"
  }
}
```
