> ## Documentation Index
> Fetch the complete documentation index at: https://docs.royaltyport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Files

> MCP tools for uploading and downloading contract and statement files.

## upload\_file

Create a staging record and return a signed upload URL. Upload the file via HTTP PUT to the returned `uploadUrl`. After the upload completes, you **must** call `upload_completed` to trigger processing.

| Parameter      | Type      | Required | Default           | Description                                     |
| -------------- | --------- | -------- | ----------------- | ----------------------------------------------- |
| `projectId`    | UUID      | Yes      | -                 | Project ID                                      |
| `resourceType` | string    | Yes      | -                 | `contract` or `statement`                       |
| `fileName`     | string    | Yes      | -                 | Original file name (e.g. `contract.pdf`)        |
| `fileType`     | string    | No       | `application/pdf` | MIME type of the file                           |
| `fileSize`     | integer   | Yes      | -                 | File size in bytes                              |
| `extractions`  | string\[] | No       | -                 | Extractions to run after upload (contract only) |

**Valid extractions:** `entities`, `artists`, `writers`, `royalties`, `splits`, `costs`, `compensations`, `dates`, `accounting-periods`, `types`, `signatures`, `control-areas`, `creative-approvals`, `balances`, `recordings`, `compositions`, `relations`

**Sample prompt:** "Upload contract.pdf and extract royalties and dates"

## upload\_completed

Signal that a file upload is complete. Call this after successfully uploading the file via HTTP PUT to the `uploadUrl` returned by `upload_file`. This triggers processing.

| Parameter      | Type   | Required | Default | Description                            |
| -------------- | ------ | -------- | ------- | -------------------------------------- |
| `stagingId`    | string | Yes      | -       | Staging ID returned from `upload_file` |
| `projectId`    | UUID   | Yes      | -       | Project ID                             |
| `resourceType` | string | Yes      | -       | `contract` or `statement`              |

**Sample prompt:** "Signal that upload stg-456 is complete"

## upload\_status

Check the processing status of an uploaded contract or statement.

| Parameter      | Type   | Required | Default | Description                            |
| -------------- | ------ | -------- | ------- | -------------------------------------- |
| `stagingId`    | string | Yes      | -       | Staging ID returned from `upload_file` |
| `projectId`    | UUID   | Yes      | -       | Project ID                             |
| `resourceType` | string | Yes      | -       | `contract` or `statement`              |

**Sample prompt:** "Check the status of upload stg-456"

## download\_file

Get a signed download URL for a contract or statement file. The URL expires in 1 hour.

| Parameter      | Type   | Required | Default | Description                 |
| -------------- | ------ | -------- | ------- | --------------------------- |
| `resourceId`   | string | Yes      | -       | Contract ID or Statement ID |
| `projectId`    | UUID   | Yes      | -       | Project ID                  |
| `resourceType` | string | Yes      | -       | `contract` or `statement`   |

**Sample prompt:** "Download contract abc-123"
