note_save
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. Body markdown is whitelist-checked (R14, UI toolbar subset — the content description lists what is allowed and rejected). Inline #tags in the body are the note's tags — the body is the single source of truth for tags; the tags parameter can only add. 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. A stale base_version returns NOTE_VERSION_CONFLICT — re-read, merge, retry; never overwrite blindly. Every success response returns the note's effective content (the server may have appended #tokens) plus its version: base any follow-up edit on that returned content, never on what you sent — notes not yet indexed have doc_id=null, so this is also how you edit a note you just created. Never rewrite a note from its snippet alone.
Optional app_name: the display name of the application you are running inside, e.g. "ChatGPT" or "Cursor" (the APPLICATION, not your model). Over an OAuth connection the server fills it in for you.
There is no delete tool — deletion is user-only in the app UI.
Scope: notes exist only on the user's Desktop. This tool takes no library parameter, always writes through the Desktop tunnel, and can never target a cloud library — there is no cloud notes store to fall back on. Desktop must be online.
Redacted values: in notes read through this server, sensitive values appear as [REDACTED:<kind> L<n>] — L<s>-<e> when the value spans several lines, such as a private key — where the numbers are lines of the note file. When editing, keep every line that holds a marker as you read it: you may move, copy, re-indent or delete the whole line (delete it only when the user asks), but do not change any other text on it. On save the Desktop puts the original values back, or returns NOTE_REDACTED_CONTENT when it cannot. Never write markers from search, grep or cloud results into a note, and never write a marker yourself; to change a hidden value, ask the user for the new value.
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. This parameter cannot remove tags — to remove one, delete its #token from `content`. Normalization: leading '#' stripped, ASCII letters lowercased. CAUTION: Desktops older than 0.11.0 instead REQUIRE tags on edit and replace the whole set with it — if the edit fails or tags vanish, ask the user to update the Desktop app. | |
| 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. Remove a tag by deleting its #token; keep tags by keeping 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 migration); delete the token later to remove such a 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 — shown as the note's source badge (e.g. "ChatGPT", "Claude", "Cursor", "Cherry Studio"). Fill it in when you know which app you are running inside; leave it out when you genuinely do not. It is the APPLICATION name, not your model name — if the only name you are sure of is the model ("GPT-5", "Claude Opus"), omit the parameter rather than sending that. Over an OAuth connection the server already knows which client is calling and fills this in for you, so sending nothing there is safe. Max 64 characters. Accepted on both create and edit. Requires an up-to-date Desktop: older Desktops reject the parameter with invalid_params — if the save fails that way, retry without app_name. Sending `null` is the same as omitting. | |
| 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. |