Skip to Content

How MCP Commands Behave

Adding files, searching, steering the reader and making audiobooks.

Add documents

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.

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

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

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

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.

outcomeWhat to do
not_openNo reader is sharing. Give the user webUrl.
needs_user_gestureThe browser is waiting for the user to press play.

Reader control has every outcome.

Voices

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

CommandLists
voices listThe 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

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

ToRun
Check on itaudiobook view <id>
Stop it, keeping its audioaudiobook cancel <id>
Resume itThe same audiobook create command
Delete the file, keeping its audioaudiobook 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.

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.

On this page

Edit this page