# finish_picture_upload

> 這個 AirBuild MCP 工具會檢查上傳的圖片，並把它設為團隊、專案、Agent、群組的圖片或聊天的背景圖片。

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

`finish_picture_upload` 是設定圖片的最後一步。用 [start_picture_upload](https://air.build/tw/docs/mcp-tools/start_picture_upload/) 提供的 `howTo` 指令上傳位元組後，它會檢查圖片是否完整送達、大小是否與你提供的一致、格式是否確實是你指定的格式，然後把它設為圖片。團隊中的所有人都會看到這項變更。請傳送與 `start_picture_upload` 相同的 `target`、`targetId`、`mediaType` 和 `byteCount`。如果檢查失敗，上傳的內容會被捨棄：請重新開始。它本身不會上傳任何內容。

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

## 輸入

| 輸入 | 類型 | 必填 | 預設值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字串（UUID） | 是 | — | 團隊，來自 [list_teams](https://air.build/tw/docs/mcp-tools/list_teams/) |
| `target` | `team`、`project`、`agent`、`group` 或 `wallpaper` | 是 | — | 與 [start_picture_upload](https://air.build/tw/docs/mcp-tools/start_picture_upload/#targets) 相同 |
| `targetId` | string | 除了 `team` 以外都需要 | — | 與 [start_picture_upload](https://air.build/tw/docs/mcp-tools/start_picture_upload/#targets) 相同 |
| `uploadId` | string | 是 | — | 來自 [start_picture_upload](https://air.build/tw/docs/mcp-tools/start_picture_upload/) |
| `mediaType` | `image/jpeg`、`image/png` 或 `image/webp` | 是 | — | 與 `start_picture_upload` 相同 |
| `byteCount` | 整數，至少為 1 | 是 | — | 與 `start_picture_upload` 相同 |

## 結果

| 欄位 | 說明 |
| --- | --- |
| `done` | `true`：圖片已設定 |

```json
{ "done": true }
```

## 錯誤

除了 `wallpaper` 以外，所有目標的 _Picture_ 都是 `Avatar`，該目標的則是 `Wallpaper`。

| 訊息 | 何時出現 | 處理方式 |
| --- | --- | --- |
| The uploaded _Picture_ does not match its upload session. | 上傳的檔案與你提供的大小或類型不符，或 `uploadId` 屬於另一次上傳 | 用圖片的實際類型和大小重新開始 |
| The _Picture_ body does not contain a supported JPEG, PNG, or WebP signature. | 該檔案不是 JPEG、PNG 或 WebP 圖片 | 上傳一張真正的圖片 |
| The _Picture_ mediaType does not match its encoded image format. | 該檔案的格式與 `mediaType` 不同 | 用正確的 `mediaType` 重新開始 |
| uploadId is required. | 缺少 `uploadId` | 傳送 [start_picture_upload](https://air.build/tw/docs/mcp-tools/start_picture_upload/) 傳回的那一個 |
| Image storage isn't available right now. Try again later. | 目前無法儲存圖片 | 稍後再試 |

`finish_picture_upload` 也可能傳回 [start_picture_upload](https://air.build/tw/docs/mcp-tools/start_picture_upload/#errors) 的目標錯誤。如果位元組從未上傳，或連結先過期了，它會以儲存空間錯誤失敗：請重新執行 `howTo`，或重新開始。所有工具都可能傳回的錯誤，請參閱 [伺服器與登入](https://air.build/tw/docs/mcp-tools/server/#errors)。

## 範例

```json
{"name": "finish_picture_upload", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "target": "agent", "targetId": "designer", "uploadId": "00000000-0000-0000-0000-000000000000", "mediaType": "image/png", "byteCount": 48213}}
```
