Skip to main content
Glama

save_file

Save Markdown notes into the MemDrive library, choosing new, overwrite, or append mode while archiving clipboard, local, or URL images to an assets folder with references added.

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. 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.

Input Schema

NameRequiredDescriptionDefault
modeNoWrite mode: "new" (default, fails if the file exists), "overwrite", or "append".
pathYesDestination file path, relative to the library root (for example "notes/2026-10-28.md"). Must be confirmed with the user before calling.
imagesNoImages 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.
contentYesText content to save (usually Markdown).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does: it discloses that parent directories are auto-created, that images are copied into a sibling assets/ folder and renamed "<document-name>-<timestamp>.<ext>" with a Markdown reference appended, that the on-disk original stays full quality while only the model preview is downscaled, and that the root is a hard sandbox rejecting "../" and out-of-root symlinks. It also pre-empts failure interpretation — empty clipboard still saves text and reports re-screenshot guidance, headless environments report clipboard as unsupported rather than crashing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The clipboard rule is stated three separate times (the CLIPBOARD FIRST block, the Images paragraph, and the Clipboard behavior paragraph), and the "never ask the user to paste" instruction is repeated again in the schema. The most important fact — what the tool does — is not front-loaded, appearing only after the clipboard and confirmation sections.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter mutation tool with no annotations and no output schema, the description covers everything an agent needs: write-mode semantics, directory creation, image handling and placement, sandbox limits, path normalization, and how to read the result on clipboard failure. Nothing material is left to inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: path cleaning behavior (quote stripping, ~ expansion, separator normalization), sandbox containment rules for absolute paths, and the downstream effects of the images array (where files land, how they are named, what gets appended to Markdown). Only the mode and content parameters are left to the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource — "Save text (usually Markdown) into the MemDrive memory library" — and the images paragraph makes clear it also archives binary images, which separates it from read-only siblings like read_file and search_files. The purpose statement is buried in the fourth paragraph behind a clipboard preamble, so an agent must read past a lot of material before learning what the tool fundamentally does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit routing rules for the clipboard case (use images: ["clipboard"] whenever the user mentions a screenshot, never ask for a paste), a mandatory pre-call confirmation workflow with a concrete example, and mode selection guidance ("new" fails when the file exists; "overwrite"; "append" creates when missing). These are when-to-use and how-to-behave rules an agent cannot infer from the schema.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.