note_save
Creates or edits a local markdown note in your Notes folder, with version-safe edits and automatic YAML metadata handling.
Instructions
Create or edit a local markdown card note in the user's Notes folder (mode="create" | "edit"). Notes are plain markdown files owned by the user; the server generates all YAML metadata. Create: pass content (markdown body WITHOUT YAML); optional tags. Body markdown is whitelist-checked (R14, UI toolbar subset): paragraphs/line breaks, bold, strikethrough, ordered/unordered lists, plain text only — headings, italics, quotes, code, links, tables, task lists, images and raw HTML are rejected with NOTE_INVALID_INPUT. Inline #tags in the body (outside code) become the note's tags — the body is the single source of truth for tags; the optional tags parameter adds extra tags and the server appends their #tokens to the body. Only add tags the user explicitly asked for. Write # for a literal # that is not a tag (e.g. issue numbers: #114). Edit (CAS loop): list (scope="notes") → get note_id + version → read the current full content via read(doc_id) → note_save with mode="edit", note_id, base_version=, and the NEW full content — keep the #tag tokens you want to keep, delete a #token to remove that tag (tags is optional and can only add). A stale base_version returns NOTE_VERSION_CONFLICT with the actual version — re-read, merge, retry; never overwrite blindly. Every success response returns the note's effective content (the server may have appended #tokens to what you submitted) plus its version: base any follow-up edit on that returned content, never on the content you sent. Notes not yet indexed have doc_id=null: wait for indexing, or edit your own just-created note using the version and content returned by note_save. Never rewrite a note from its snippet alone. Optional app_name: the display name of the APPLICATION hosting this conversation (NOT the model name), shown as the note's source badge — omit it entirely if unsure. There is no delete tool — deletion is user-only in the app UI.
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": {
"mode": "<mode>",
"content": "<content>"
},
"name": "note_save"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Operation mode: "create" writes a new note; "edit" rewrites an existing one. Edit REQUIRES note_id AND base_version — missing fields return NOTE_INVALID_INPUT with a fix example. | |
| tags | No | Extra tags to add — optional for both modes, unioned with the body's #tags. POLICY (R14): do NOT add tags on your own initiative — only pass tags the user explicitly asked for; never invent them. Tags missing from the body are appended to it as #tokens by the server (the body stays the single source of truth for tags). This parameter cannot remove tags — to remove one, delete its #token from `content`. Normalization: leading '#' stripped, ASCII letters lowercased. | |
| content | Yes | Markdown body without YAML front matter. The server generates and owns all YAML metadata (note_id, timestamps, source, tags). ALLOWED markdown (R14 whitelist = UI toolbar subset, enforced at AST level): paragraphs/line breaks, bold, strikethrough, ordered/unordered lists, plain text (bare URLs as plain text are fine). EVERYTHING ELSE is rejected — headings, italics, blockquotes, inline code, code blocks, links, images, raw HTML, thematic breaks, GFM tables, task lists and footnotes — with NOTE_INVALID_INPUT listing the offending constructs (edits may keep constructs the note already contains, but must not introduce new forbidden kinds). Inline #tags in the body (outside code) ARE the note's tag set — the body is the single source of truth for tags. To write a literal # that must NOT become a tag (issue or PR numbers such as #114 or api#43), escape it as \#114 — the app shows it as #114. To remove a tag on edit, delete its #token from the body; to keep tags, keep their #tokens. Legacy tags stored only in YAML (no #token in the body yet) are preserved on edit: the server appends their #tokens to your content (one-time in-place migration); delete such a token in a later edit to remove that tag. | |
| note_id | No | Note UUID. Required for mode="edit" (identifies the note). Optional for mode="create" and reserved for future cloud sync — a create carrying an existing note_id is rejected as NOTE_DUPLICATE_ID. | |
| app_name | No | Display name of the HOST APPLICATION this conversation runs inside (e.g. "Cursor", "Cherry Studio", "Claude Desktop") — shown as the note's source badge in the app. This is the application's name, NOT your model name. OMIT this parameter entirely unless you are certain which application hosts this conversation — a missing value shows a neutral badge, a wrong value misleads the user. Max 64 characters. Accepted on both create and edit. | |
| base_version | No | The note's current version hash (sha256 of the raw file), required for mode="edit". Obtain it from `list` (scope="notes") or a previous note_save response. A stale value returns NOTE_VERSION_CONFLICT with the actual version — re-read before retrying; never overwrite blindly. |