create_attachment_upload
The AirBuild MCP tool that starts uploading a file to attach to a message: it answers a one-time upload URL and the curl command that sends the bytes.
create_attachment_upload starts uploading a file you want to attach to a message. It reserves the attachment and answers an upload URL; it does not move any bytes itself, since an MCP call cannot carry a file. You send the file with one HTTP PUT, finish with complete_attachment_upload, and attach it with send_message. An attachment belongs to the Team, not to one channel, and nobody sees it until it is sent in a message.
| Read-only | Destructive | Idempotent |
|---|---|---|
| No | No | No |
The upload, step by step
- Call
create_attachment_uploadwith the file’s name, media type and exact size in bytes. - Send the file’s bytes with one HTTP
PUTtouploadUrl, with the headerContent-Typeset tocontentType. ThehowTofield is that command ready to run: replace<path-to-file>with the file’s path. The upload URL needs noAuthorizationheader, and it works untilexpiresAt. - Call complete_attachment_upload with the
attachmentId. AirBuild checks that the bytes match what you declared. - Pass the
attachmentIdinattachmentIdsto send_message.
Inputs
| Input | Type | Required | Default | What it does |
|---|---|---|---|---|
teamId |
string (UUID) | Yes | — | The Team, from list_teams |
fileName |
string, 1 to 255 characters | Yes | — | The name people see, e.g. report.pdf. No /, \ or control characters, and not . or .. |
mediaType |
string, at most 255 bytes | Yes | — | The file’s media type, e.g. image/png or application/pdf. A concrete type: image/* is refused. Use application/octet-stream when you do not know it |
byteCount |
integer, at least 1 | Yes | — | The file’s exact size in bytes. The upload must be exactly this size |
Result
| Field | What |
|---|---|
attachmentId |
The attachment’s id (a UUID). Pass it to complete_attachment_upload, then to send_message |
uploadUrl |
Where to PUT the bytes |
method |
PUT |
contentType |
The Content-Type header the PUT must carry: mediaType in lower case |
expiresAt |
When the upload URL stops working (ISO 8601) |
howTo |
A curl command that does the PUT |
{
"attachmentId": "00000000-0000-0000-0000-000000000000",
"uploadUrl": "https://<upload-host>/<path>",
"method": "PUT",
"contentType": "application/pdf",
"expiresAt": "2026-11-21T09:30:00Z",
"howTo": "curl -sS -X PUT -H 'Content-Type: application/pdf' --upload-file <path-to-file> 'https://<upload-host>/<path>'"
}Errors
Italic words stand for the values in the sentence.
| Message | When | What to do |
|---|---|---|
| fileName is required. | fileName is missing or only spaces |
Send the file’s name |
| byteCount is required. | byteCount is missing |
Send the file’s size in bytes |
| An Attachment must contain at least one byte. | byteCount is 0 |
An empty file cannot be attached |
| This file exceeds the N-byte limit. Choose a smaller file. | byteCount is over the Team’s limit for one file |
Send a smaller file, or split it |
| Attachment fileName must contain 1…255 safe characters without path separators or control characters. | fileName is too long, is . or .., or contains /, \ or control characters |
Send a plain file name |
| Attachment mediaType must be a concrete IANA media type such as application/octet-stream. | mediaType is not type/subtype, or uses * |
Send a real media type, or application/octet-stream |
| File uploads aren’t available right now. Try again later. | Uploads are not available at the moment. | Try again later |
| Unable to save this attachment right now. Try again. | AirBuild could not record the attachment | Try again |
| Team not found. | The Team does not exist, or you are not in it | Use a teamId from list_teams |
The errors every tool can return are on Server and sign-in.
Example
{"name": "create_attachment_upload", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "fileName": "report.pdf", "mediaType": "application/pdf", "byteCount": 482113}}