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

# File tools

> Tools for listing, reading, uploading, and publishing Files & Docs.

`file` · 14 tools · Mounted by `default`

Files & Docs live under a Workspace, a Canvas, or a chat. These tools list them, read them, move them, and hand out links to them.

Every call also carries an exit code and timing in `_meta`, and errors come back as results rather than transport failures. See [Results](/reference/results).

## cohesive\_file\_copy

**Hints** — destructive

Copy a file record to a new parent or path. Copies a file record to a new destination; the source is untouched. The path rule matches upload. overwrite replaces the contents of an existing record at the destination path, preserving its ID and share state. Exactly one of: workspace, canvas, chat.

| Argument         | Type    | Required | Description                                                                                  |
| ---------------- | ------- | -------- | -------------------------------------------------------------------------------------------- |
| `file_record_id` | string  | Required | File record id.                                                                              |
| `canvas`         | string  | Optional | Copy into a canvas.                                                                          |
| `chat`           | string  | Optional | Copy into a chat (flow session).                                                             |
| `overwrite`      | boolean | Optional | Replace the contents of an existing record at the destination path.                          |
| `path`           | string  | Optional | Destination path; without an extension (or with a trailing /) the current file name is kept. |
| `workspace`      | string  | Optional | Copy into a workspace.                                                                       |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_delete

**Hints** — destructive

Delete a file record. Soft-deletes a file record. Recently deleted records can be restored with `cohesive_file_recover`.

| Argument         | Type   | Required | Description     |
| ---------------- | ------ | -------- | --------------- |
| `file_record_id` | string | Required | File record id. |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_get

**Hints** — read-only, idempotent

Show one file record. view\_url is the URL to show a person; raw\_url serves the bytes for fetching or embedding and is not for people; dashboard\_url opens the record in the app for a signed-in user. download\_url is a signed link to the bytes, valid until download\_url\_expires\_at: the way to move a file anywhere, or to read one `cohesive_file_read` cannot return inline.

| Argument         | Type   | Required | Description     |
| ---------------- | ------ | -------- | --------------- |
| `file_record_id` | string | Required | File record id. |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_list

**Hints** — read-only, idempotent

List file records under one parent resource, recent files, or deleted files. Lists file records scoped to exactly one parent — a workspace, a canvas, or a chat (flow session) — or one of two cross-workspace views (newest first; page with before): recent, your recently modified Library files, and deleted, recently deleted files still restorable with `cohesive_file_recover`. Exactly one of: workspace, canvas, chat, recent, deleted. view\_url is the URL to show a person; raw\_url serves the bytes for fetching or embedding and is not for people; dashboard\_url opens the record in the app for a signed-in user.

| Argument    | Type    | Required | Description                                                         |
| ----------- | ------- | -------- | ------------------------------------------------------------------- |
| `before`    | string  | Optional | Cursor for recent/deleted: the previous page's pagination next\_ts. |
| `canvas`    | string  | Optional | List a canvas's file records.                                       |
| `chat`      | string  | Optional | List a chat's (flow session's) file records.                        |
| `deleted`   | boolean | Optional | List recently deleted files (restorable for 14 days).               |
| `limit`     | integer | Optional | Page size for recent/deleted (server default 20, max 100).          |
| `recent`    | boolean | Optional | List your recently modified Library files.                          |
| `workspace` | string  | Optional | List a workspace's file records.                                    |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_mkdir

**Hints** — idempotent

Create an empty file-system directory. Creates a folder-kind file record — a file-system directory — under exactly one parent: a workspace, a canvas, or a chat (flow session). Directories normally come into being when a file path names them; mkdir exists so an empty directory can be prepared before files move in. Organizing files into folders is this plus `cohesive_file_move` path.

Not to be confused with the left-rail folders that organize canvases and chats themselves — those are a separate concept, and these directories only ever group file records. Exactly one of: workspace, canvas, chat.

| Argument    | Type   | Required | Description                                    |
| ----------- | ------ | -------- | ---------------------------------------------- |
| `canvas`    | string | Optional | Create the directory in a canvas.              |
| `chat`      | string | Optional | Create the directory in a chat (flow session). |
| `path`      | string | Required | Directory path to create.                      |
| `workspace` | string | Optional | Create the directory in a workspace.           |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_move

**Hints** — destructive, idempotent

Move a file record to a new parent or path. Moves a file record to a new destination. The path rule matches upload: no extension or a trailing / means a directory (the current file name is kept); an extensioned path renames. Omitting path keeps the name at the destination root. Exactly one of: workspace, canvas, chat.

| Argument         | Type   | Required | Description                                                                                  |
| ---------------- | ------ | -------- | -------------------------------------------------------------------------------------------- |
| `file_record_id` | string | Required | File record id.                                                                              |
| `canvas`         | string | Optional | Move into a canvas.                                                                          |
| `chat`           | string | Optional | Move into a chat (flow session).                                                             |
| `path`           | string | Optional | Destination path; without an extension (or with a trailing /) the current file name is kept. |
| `workspace`      | string | Optional | Move into a workspace.                                                                       |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_promote

**Hints** — destructive

Move a canvas or chat file into the workspace Library. Moves a canvas or chat file into the workspace Library — what dragging it to the Library does in the app. The file keeps its ID, and a reference (a link record) is left behind in its source container in the same action, so the canvas or chat still shows the file, now pointing at its Library home.

workspace defaults to the source container's workspace, and parent\_path places the file under a Library directory (default: the Library root).

| Argument         | Type   | Required | Description                                                    |
| ---------------- | ------ | -------- | -------------------------------------------------------------- |
| `file_record_id` | string | Required | File record id.                                                |
| `parent_path`    | string | Optional | Library directory to place the file under (default: the root). |
| `workspace`      | string | Optional | Library workspace (default: the source container's workspace). |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_publish

**Hints** — idempotent

Publish a file record to a public URL. Makes a file record publicly readable — anyone with the URL can view it, no Cohesive account needed. Two URLs come back. "Public URL" (view\_url in JSON) is the viewer page: the one to give a person. "Raw URL" (raw\_url) serves the file's bytes: use it to fetch the content, embed the file in another file, or hand it to another service — never as the URL you show someone. Revoke with `cohesive_file_unpublish`. view\_url is the URL to show a person; raw\_url serves the bytes for fetching or embedding and is not for people; dashboard\_url opens the record in the app for a signed-in user.

| Argument         | Type   | Required | Description     |
| ---------------- | ------ | -------- | --------------- |
| `file_record_id` | string | Required | File record id. |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_read

**Hints** — read-only, idempotent

Print a file record's content. Returns a file record's bytes. For reading, not transfer: text comes back inline up to the output cap and an image up to 3 MiB as an image block; anything else is refused. To move a file anywhere, or read one that does not fit, use `cohesive_file_get` and hand its download\_url to whatever needs the bytes.

| Argument         | Type   | Required | Description     |
| ---------------- | ------ | -------- | --------------- |
| `file_record_id` | string | Required | File record id. |

**Returns** — The file's own bytes — text inline, images as an image block, and a pointer to `cohesive_file_get` when neither fits.

## cohesive\_file\_recover

**Hints** — idempotent

Restore a recently deleted file record.

| Argument         | Type   | Required | Description     |
| ---------------- | ------ | -------- | --------------- |
| `file_record_id` | string | Required | File record id. |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_reference

**Hints** — writes (no read-only or destructive hint)

Place a reference to a file on a canvas or in a chat. Creates a reference to a file: the reference is its own file record (kind "link") living in the canvas or chat and pointing at the workspace file. The file itself does not move — this is how a Library file, including one from another workspace, is placed onto a canvas without copying it. Copy instead (`cohesive_file_copy`) only when you want a separate file with a separate history.

Referencing the same file in the same container twice is a no-op; the output says whether the reference already existed. Exactly one of: canvas, chat.

| Argument         | Type   | Required | Description                                  |
| ---------------- | ------ | -------- | -------------------------------------------- |
| `file_record_id` | string | Required | File record id.                              |
| `canvas`         | string | Optional | Reference the file on a canvas.              |
| `chat`           | string | Optional | Reference the file in a chat (flow session). |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_references

**Hints** — read-only, idempotent

List the references pointing at a file. Lists the link records that reference this file from canvases and chats. The listing is filtered to the containers you can view.

| Argument         | Type   | Required | Description     |
| ---------------- | ------ | -------- | --------------- |
| `file_record_id` | string | Required | File record id. |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_unpublish

**Hints** — destructive

Revoke a file record's public URL.

| Argument         | Type   | Required | Description     |
| ---------------- | ------ | -------- | --------------- |
| `file_record_id` | string | Required | File record id. |

**Returns** — JSON, as text content and as structured content.

## cohesive\_file\_upload

**Hints** — destructive

Upload a file to a workspace, canvas, or chat. Uploads a file record under exactly one parent: a workspace, a canvas, or a chat (flow session). Pass the file's text as content, or a public URL as from\_url for the server to fetch and store the bytes.

path is the destination and names the file exactly, extension included; a directory path has no file name to complete it here. It is required with content, and with from\_url it can be omitted to let the server name the file from the URL.

Processing (previews, text extraction, summary) continues server-side after upload; wait blocks until the record reaches status "processed". Exactly one of: workspace, canvas, chat. Exactly one of: content, from\_url. There is no base64 property: never encode file bytes into a call.

| Argument    | Type    | Required | Description                                                                                                                                           |
| ----------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content`   | string  | Optional | The file's text, when you are its author; for existing bytes use from\_url.                                                                           |
| `canvas`    | string  | Optional | Upload into a canvas.                                                                                                                                 |
| `chat`      | string  | Optional | Upload into a chat (flow session).                                                                                                                    |
| `force`     | boolean | Optional | Skip the content/extension mismatch check.                                                                                                            |
| `from_url`  | string  | Optional | Fetch the bytes server-side from a URL and store them: any public URL, including another service's presigned or signed download URL.                  |
| `overwrite` | boolean | Optional | Replace the contents of an existing record at the destination path.                                                                                   |
| `path`      | string  | Optional | The destination, naming the file exactly with its extension; required with content, optional with from\_url (the server names the file from the URL). |
| `wait`      | boolean | Optional | Block until server-side processing completes.                                                                                                         |
| `workspace` | string  | Optional | Upload into a workspace.                                                                                                                              |

**Returns** — JSON, as text content and as structured content.
