save_file
Saves text or Markdown notes and images, including screenshots taken straight from the clipboard, into your MemDrive library. Creates folders as needed and supports new, overwrite, or append modes.
Instructions
CLIPBOARD FIRST — READ THIS BEFORE ANYTHING ELSE: When the user says to save a screenshot or an image from the clipboard — for example "把截图存下来", "把剪贴板里的图存下来", "save the screenshot", or any equivalent wording — pass images: ["clipboard"]. That is all it takes: the server reads the clipboard directly on the user's own machine. You do NOT need to see the clipboard or the image. NEVER ask the user to paste, upload, or send the image into the chat. NEVER say you cannot read the clipboard, that you cannot see images, or that this memory library can only store text. If the clipboard holds no image, the server reports that in the result and the text is still saved — tell the user to take the screenshot again and retry; do not invent a clipboard failure.
Interaction rule — read before calling:
Before calling this tool, show the user the EXACT destination path and
filename you intend to write (for example: "notes/2026-10-28.md") and
get their explicit confirmation in the chat. Never call save_file with
a path or filename the user has not confirmed. If the user has not
confirmed a location yet, ask them first instead of calling.
There is no popup or confirmation dialog: confirmation happens here,
in the conversation, through you.
Save text (usually Markdown) into the MemDrive memory library.
Modes: "new" (default) fails when the file already exists; "overwrite" replaces it; "append" adds to the end, creating the file when missing. Parent directories are created automatically.
Tags: two syntaxes are supported — YAML front matter tags: (inline [a, b] or block - a) and body #tag. Proactively suggest adding tags ONLY in these three cases: (1) the user mentions a category or topic while saving (e.g. saving a work plan); (2) the note clearly belongs to a tag already used in the library; (3) the user saves several notes on the same topic in a row (ask once, e.g. whether to tag all of them X). NEVER ask about tags for quick screenshot/clipboard saves, when the user only said "save it" with no topic signal, or after you already asked once in this conversation and the user ignored it or said no. When the user explicitly asks to save with tags, just save with those tags — none of the rules above apply. If the tool result includes a Tip: line about tagging, you MUST say that tip to the user.
Images: pass an "images" array with any mix of the literal string "clipboard" (capture the latest screenshot from the OS clipboard — see the clipboard rule above), local file paths, or http(s) image URLs. Images are copied/downloaded/captured into a sibling assets/ folder, renamed "-.", and for Markdown files a standard image reference is appended to the document automatically. The on-disk original is always kept at full quality; only the preview handed to a model is ever downscaled.
Clipboard behavior: when the clipboard is empty or holds text instead of an image, the text is still saved and the result explains what to do (re-screenshot). Clipboard capture never crashes the server; in headless environments it reports itself as unsupported and suggests a file path or URL instead.
Paths are relative to the library root (MEMDRIVE_ROOT). Absolute paths are accepted only when they stay inside the root. The root is a hard sandbox: "../" escapes and symlinks pointing outside are rejected.
Path cleaning: surrounding quotes are stripped, a leading ~ expands to the home directory, and separators are normalized.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"content": "<content>"
},
"name": "save_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Write mode: "new" (default, fails if the file exists), "overwrite", or "append". | |
| path | Yes | Destination file path, relative to the library root (for example "notes/2026-10-28.md"). Must be confirmed with the user before calling. | |
| images | No | Images to archive with the document — CLIPBOARD FIRST: the literal string "clipboard" captures the latest screenshot/image from the OS clipboard on the machine running the server. Use it whenever the user mentions a screenshot or the clipboard: never ask them to paste the image into the chat, and never claim the clipboard cannot be read. Local file paths and http(s) image URLs are also accepted. | |
| content | Yes | Text content to save (usually Markdown). |