# complete_attachment_upload

> The AirBuild MCP tool that checks an uploaded file against what was declared and makes the attachment ready to send.

Source: https://air.build/docs/mcp-tools/complete_attachment_upload/

`complete_attachment_upload` finishes an upload started with [create_attachment_upload](https://air.build/docs/mcp-tools/create_attachment_upload/): after you have sent the bytes with the `PUT`, it checks that the uploaded file has the size and media type you declared and marks the attachment `ready`. Only then can [send_message](https://air.build/docs/mcp-tools/send_message/) attach it. It does not upload anything, and it does not send a message. Calling it again on a ready attachment answers the attachment as it is.

| Read-only | Destructive | Idempotent |
| --- | --- | --- |
| No | No | Yes |

## Inputs

| Input | Type | Required | Default | What it does |
| --- | --- | --- | --- | --- |
| `attachmentId` | string (UUID) | Yes | — | The `attachmentId` from [create_attachment_upload](https://air.build/docs/mcp-tools/create_attachment_upload/) |

## Result

| Field | What |
| --- | --- |
| `attachment.id` | The attachment's id |
| `attachment.fileName` | The file name |
| `attachment.mediaType` | The media type, in lower case |
| `attachment.byteCount` | The size in bytes |
| `attachment.status` | `ready` |
| `attachment.altText` | A description of the image for people who cannot see it, or `null` (this tool sets none) |

```json
{
  "attachment": {
    "id": "00000000-0000-0000-0000-000000000000",
    "fileName": "report.pdf",
    "mediaType": "application/pdf",
    "byteCount": 482113,
    "status": "ready",
    "altText": null
  }
}
```

## Errors

| Message | When | What to do |
| --- | --- | --- |
| The completed object does not match the Attachment upload declaration. | The uploaded file's size or `Content-Type` is not what was declared, or the bytes went to another upload | The attachment is discarded: start again with [create_attachment_upload](https://air.build/docs/mcp-tools/create_attachment_upload/), and send the exact `byteCount` with the given `contentType` |
| The Attachment upload state cannot be completed. | The upload can no longer be finished | Start again with [create_attachment_upload](https://air.build/docs/mcp-tools/create_attachment_upload/) |
| The Attachment upload state changed before it became ready. | Another call changed the upload while this one was checking it | Call again; if it fails again, start a new upload |
| Attachment not found. | No attachment has this id, or it was discarded | Use the `attachmentId` from [create_attachment_upload](https://air.build/docs/mcp-tools/create_attachment_upload/) |
| Team not found. | The attachment belongs to a Team you are not in | Use an attachment of one of your Teams |
| File uploads aren't available right now. Try again later. | Uploads are not available at the moment. | Try again later |

When the bytes were never uploaded, AirBuild cannot find them and the call fails with a storage error: do the `PUT` first. The errors every tool can return are on [Server and sign-in](https://air.build/docs/mcp-tools/server/#errors).

## Example

```json
{"name": "complete_attachment_upload", "arguments": {"attachmentId": "00000000-0000-0000-0000-000000000000"}}
```
