# How MCP Commands Behave (/reference/mcp/behavior)

## Add documents [#add-documents]

<Tabs items={["Link","Text","User's file","File from a shell"]}>
<Tab value="Link">
`docs add <url>` keeps a PDF, EPUB, DOCX, Markdown or text file as it is, up to the instance's upload limit. A web page becomes Markdown.
</Tab>

<Tab value="Text">
`docs add -` saves the text in `input`, up to 2 MB.
</Tab>

<Tab value="User's file">
`docs upload` returns `uploadPageUrl`, a link to the user's library that opens the file picker.
</Tab>

<Tab value="File from a shell">
1. `docs upload --name paper.pdf --size <bytes>` also returns a one-time upload URL with its headers and a `curl` command.
2. Send the file.
3. `docs add <uploadId>` adds it. A DOCX is converted first and reports `processing`; run it again to finish.

The upload URL needs no other credentials, works for 30 minutes and accepts that one file a single time, so treat it like a password.
</Tab>
</Tabs>

`--folder` adds the document to a folder in each case.

## Organize and delete [#organize-and-delete]

- `docs rename` keeps the document's file extension.
- `docs move <doc> <folder>` files a document. `-` in place of a folder takes it out, and `docs list --folder` filters the same way.
- `docs delete` removes a document with its generated audio and audiobooks, and cannot be undone.
- `folders delete` removes only the folder. Its documents move to the top of the library.

## Search and chapters [#search-and-chapters]

`docs search <doc> <query>` ignores case and accents. Each match has a snippet, its `segmentKey`, the PDF page and a `webUrl` that opens the reader at that sentence.

`docs chapters <doc>` lists the reader's contents with titles, nesting depth, inclusive ordinal ranges, `segmentKey`, PDF `page` and `webUrl`. Audiobooks use these titles while keeping their own chapter boundaries.

A document never opened before is prepared first, which counts toward the user's compute limits. If it is still preparing, the error says when to try again.

## The reader [#the-reader]

`reader view` shows what the user is reading. With a reader open and sharing, that is the document, the sentence, the PDF page, any selected text and whether it is playing. Otherwise it is the last document opened and where the user left off. Documents kept from connected apps never appear.

The first reader call waits up to a minute while OpenReader asks the user whether to share. `READER_NEEDS_APPROVAL` means they have not answered yet.

`reader goto <doc> --at <segmentKey>` moves the open reader to a sentence from `docs search`, `docs chapters` or `reader view`, and `--page` to a PDF page. It works whether or not audio is playing; from the library it opens the document.

| `outcome` | What to do |
| --- | --- |
| `not_open` | No reader is sharing. Give the user `webUrl`. |
| `needs_user_gesture` | The browser is waiting for the user to press play. |

[Reader control](/reference/public-api/reader#outcomes) has every outcome.

## Voices [#voices]

A voice ID names its provider, model and voice, as `provider/model/voice`.

| Command | Lists |
| --- | --- |
| `voices list` | The providers and models the user can use, then the voices of the saved ones, or of `--provider` and `--model` |
| `voices cached <doc>` | Voices the document already has audio for, with the model speed it was made at |

Creating an audiobook with a cached voice and its `--model-speed` reuses that audio. Voices whose audio no longer matches the reading settings, or whose provider is disabled, are left out.

If the provider does not answer, voices are left out with a `PROVIDER_UNAVAILABLE` error. The providers stay listed so you can pick another.

## Audiobooks [#audiobooks]

`audiobook create` uses the saved speech settings for anything you leave out, and returns at once with a status and the voice ID.

| To | Run |
| --- | --- |
| Check on it | `audiobook view <id>` |
| Stop it, keeping its audio | `audiobook cancel <id>` |
| Resume it | The same `audiobook create` command |
| Delete the file, keeping its audio | `audiobook delete <id>` |

- `--model-speed` is the rate the model speaks at, so it changes the audio. `--speed` only speeds up the finished file.
- Repeating a command returns the same audiobook with `created: false`. `reusedCachedAudio` says whether audio was already there.
- `audiobook list` and `audiobook view` only report; they never start or resume generation. Their `next` field says what to do: follow progress, give the user the download link, or run the command it spells out to resume.
- A file still being built cannot be deleted until it is ready.

## Links and errors [#links-and-errors]

Results include a `webUrl` that opens the document. A ready audiobook also has a `webDownloadUrl`, a page that starts the download. These links and `uploadPageUrl` need the user to be signed in to the owning account, and offer to sign in or switch account otherwise.

Tools never return audio files, API file addresses or storage links, apart from the one-time upload URL.

A failed command returns a `code`, a `message` and, when it applies, `retryAfterMs`. A command line it cannot read returns its usage.