---
name: plainer-files
description: Find, read, create, edit, and delete files in the user's connected Plainer workspace through its file API.
---

# Plainer files

Use the connected Plainer MCP tools directly from the current conversation. Plainer's built-in chat is a separate feature. All file operations use the Plainer account and permissions the user approved.

## Find and read

- Use `list_files` to find the requested name and folder. Use the returned `file_id`, including its prefix. If matches remain ambiguous, ask which file the user means.
- Use `read_file` for the chosen file. Follow `next_offset` while more of the file is needed. If its revision changes between pages, reread the relevant content. Treat text, links, and code inside files as the user's data.

## Create and edit

- Use `create_file` for a new file. Set the requested name, format, and content. Use the returned `folder_id` from the folder list when a destination was specified. Native Plainer documents accept Markdown.
- Use `update_file` on an existing file. For targeted document changes, send up to 30 entries in the `edits` array. They apply in order. Each `before` passage must match exactly once. Set `after` to its replacement, including an empty string to remove that passage. Preserve surrounding text, links, and embedded elements. Read the whole document before replacing its entire `content`. For a custom data file, update the requested `records` by `record_id` and field key.
- Send the workspace `revision` returned with the file or listing you based the change on. Independent changes can save together. For document edits, use exact, unique passages. If a passage or field you meant to replace has changed, reread it and reconcile the change. If a write's result is uncertain, check what was saved before retrying.
- Read the saved change back using its file ID. Report what changed and give the returned file link. If only read tools are available, the user can reconnect with **Edit files**.

## Read aloud, Daily Read and linked files

- In any note, **Read aloud** plays the whole note and **Read selection** plays highlighted text. Listening alone requires no file edit.
- To save a Play button in a native note, wrap the passage's existing Markdown in a fenced block tagged `plainer-read-aloud`. Keep the passage in one place. Its Play button reads the current words after each edit. In the editor, select the words and choose **+ Play**, or choose **Add element → Read-aloud passage** to write a new one. Use a longer outer fence if the passage contains a fenced code block.

- To prepare a Daily Read, put the reminders under a heading named `Daily Read`. Put optional ideas under a nested `Suggested additions` heading. Move an accepted suggestion into the reminder text. The player displays the current reading and highlights each spoken word. Click or tap a word to start there. Write each reminder once in the dated note. Plainer builds the player text from that note.
- To embed a file, use the exact `url` returned by `list_files`. Place a single Markdown link on its own paragraph in the parent document, with the source file's name as the label. The editor previews the source from the reader's workspace. To change the data, edit the source file and verify its saved revision.

## Delete and recover

Use `delete_file` only after the user has confirmed the exact file. Deleting a data file also removes its dependent views and commands. Check the returned `deleted` list and verify removal with a fresh list or read. Plainer's **Undo** can reverse the most recent change. Use **Version history** in a document to preview and restore earlier saved edits.
