Update an existing snippet in-place. Use this tool (NOT add_snippet) whenever the user wants to edit, modify, or change an existing snippet.
Workflow: First call search_snippets to find the snippet. From the results, note the _id, groupId, and dateUpdated fields. Use get_snippet if you need to read the full current content before editing. Use that snippet's _id as snippetId (NOT the groupId — they are different). Then call this tool with the changes.
IMPORTANT: When presenting results to the user, show only the abbreviation and confirm what was changed. Never display internal IDs (_id, groupId, snippetId, dateUpdated) in conversation — those are for internal tool use only.
Content supports macros and markdown formatting.
Macros: %fill:Label%, %fill:Label=Default%, %fill-area:Label%, %fill-date:Label%, %fill-date:Label:format%, %popup:Label:OptA,OptB,OptC%, %popup:Label:OptA,OptB:1% (1 = default index), %date:YYYY-MM-DD%, %embed:abbreviation%, %clipboard%, %cursor%, %key:tab%, %key:return%, %key:enter%, %key:esc%, %optional-begin:Label%, %optional-begin:Label:included%, %optional-end%, %conditional-begin:Label%, %conditional-begin:Label:N% (N = default branch index), %branch:BranchName%, %conditional-end%
IMPORTANT: When a snippet needs a date, always use %fill-date:Label% (date picker) so the user can choose the date at expansion time. Use %date:format% only for auto-inserting today's date with no user interaction. Never hardcode a date value.
Formatting: **bold**, *italic*, ***bold italic***, [link text](url). snippetType auto-detects to 7 (Formatted Text) when formatting is used.
Plain text: set plainText to true to store the content exactly as written — markdown characters (**, *, ***, [](), etc.) are kept literal instead of being converted to styling, and the snippet stays plain text (snippetType 6). Macros still expand normally. Use this when the expanded output feeds another system that needs literal markdown syntax (e.g. an LLM prompt), not visual formatting.
Rich styling / lossless edits: content also accepts the snippet's node structure directly — pass the JSON object that get_snippet returns in its jsonContent field (shape {"nodes":[...]}) as the content string, and the server stores those nodes verbatim, skipping markdown parsing. This is the ONLY way to preserve or set styling that markdown can't express (font, size, color, bulleted/numbered lists, tables). Editing a formatted snippet with plain markdown content instead will DROP that styling (bold/italic/links survive; fonts/sizes/colors/lists do not). To edit losslessly: get_snippet, modify the jsonContent nodes, then send that JSON back as content.
IMPORTANT: Popup options are plain text only. They cannot contain %fill%, %date%, %embed%, or any other macro, and cannot contain commas. If you want a personalized greeting chosen from a menu, place the popup and any other macros side by side instead of nesting: `%popup:Tone:Hi,Hello,Hey:0% %fill:CustomerName%, thanks for reaching out!`. Do NOT write `%popup:Tone:Hi %fill:Name%,Hello %fill:Name%:0%` — the server will reject it.
Conditional sections let the user pick ONE of several named branches at expansion time (shown as a dropdown), where each branch expands to its own content. Structure: %conditional-begin:Label% then one %branch:BranchName% before each branch's content, then %conditional-end%. Example: %conditional-begin:Greeting%%branch:Formal%Dear Sir or Madam,%branch:Casual%Hey!%conditional-end%. Add a trailing number to conditional-begin to preselect a branch (e.g. %conditional-begin:Greeting:1% defaults to the second branch; branches are 0-indexed). Unlike popup options, a branch's content is rich — it may contain text, markdown, and other macros (%fill%, %date%, etc.).
Notes: Nested markdown not supported. Markdown not parsed inside macro parameters.
update_snippet