# Files

> MCP tools for the Files module. See the [Files module docs](/docs/modules/files) for permissions and data model.

# Files

MCP tools for the Files module. See the [Files module docs](/docs/modules/files) for permissions and data model.

### `list-files`

List all files

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `project_id` | `string` | no | Filter files by project ID |
| `limit` | `number` | no | Maximum number of results to return |
| `offset` | `number` | no | Number of results to skip |

### `create-file`

Create a file

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `project_id` | `string` | no | Public ID of the project. Optional when authenticating with a project-scoped API key, which defaults to the key's project; required otherwise. |
| `prefix` | `string` | no | Directory within the project (e.g. /images). Optional; defaults to / (root). Combined with filename to form the file's key (path). |
| `filename` | `string` | no | Original / download name and the key's leaf segment (e.g. logo.png). |
| `content_type` | `string` | no | MIME type of the file |
| `size` | `number \| null` | no | File size in bytes |
| `metadata` | `string` | no | JSON string with additional metadata |

### `upload-file`

Upload a file

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file` | `string` | yes | File content |
| `project_id` | `string` | no | Project ID to associate the file with. Optional when authenticating with a project-scoped API key, which defaults to the key's project; required otherwise. |
| `prefix` | `string` | no | Directory within the project (e.g. /images). Optional; defaults to / (root). |
| `filename` | `string` | no | Original / download name. Optional; defaults to the uploaded file's name. |
| `metadata` | `string` | no | Additional metadata as a JSON string |

### `upload-file-base64`

Upload a file using base64 encoding

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `project_id` | `string` | no | Public ID of the project |
| `content` | `string` | yes | Base64-encoded file content |
| `prefix` | `string` | no | Directory within the project (e.g. /documents). Optional; defaults to / (root). |
| `filename` | `string` | no | Original / download name and the key's leaf segment. |
| `content_type` | `string` | no | MIME type of the file |
| `metadata` | `string` | no | JSON string with additional metadata |

### `create-presigned-url`

Create a presigned upload URL

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `project_id` | `string` | yes | Public ID of the project |
| `prefix` | `string` | no | Directory within the project (e.g. /documents). Optional; defaults to / (root). |
| `filename` | `string` | no | Original / download name and the key's leaf segment. |
| `content_type` | `string` | no | MIME type of the file to be uploaded |

### `upload-file-with-token`

Upload a file using an upload token

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `token` | `string` | yes | The single-use upload token (e.g. upt_...) |
| `content` | `string` | no | Base64-encoded file content (alternative to multipart `file`) |
| `filename` | `string` | no | Original / download name (overrides the token's filename) |
| `content_type` | `string` | no | MIME type of the file (overrides the token's content type) |
| `metadata` | `string` | no | JSON string with additional metadata |

### `get-file`

Get a file by ID

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file_id` | `string` | yes | File ID |

### `delete-file`

Delete a file

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file_id` | `string` | yes | ID of the file to delete |

### `update-file-metadata`

Update file metadata

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file_id` | `string` | yes | File ID |
| `metadata` | `string` | no | New metadata as a JSON string |
| `prefix` | `string` | no | New directory — moves the file. The resulting path (prefix + filename) must be unique within the project. |
| `filename` | `string` | no | New filename — renames the key's leaf and the download name. |

### `download-file-base64`

Download file as base64

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file_id` | `string` | yes | File ID |
| `token` | `string` | no | Signed single-file download token, an alternative to a bearer credential (issued for ingestion-rule converters). |

### `get-file-tags`

Get file tags

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file_id` | `string` | yes | File ID |

### `replace-file-tags`

Replace file tags

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file_id` | `string` | yes | File ID |

### `merge-file-tags`

Merge file tags

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `file_id` | `string` | yes | File ID |
