Add a NEW snippet to a snippet group. Only use this for creating brand new snippets.
Before creating, this tool automatically checks for similar existing snippets. If highly similar snippets are found (similarity >= 0.7), it returns them as recommendations instead of creating a duplicate. To override this and force creation, set skipDuplicateCheck to true.
IMPORTANT: Do NOT use this tool to edit or modify an existing snippet — it will create a duplicate. To modify an existing snippet, use update_snippet instead. First call search_snippets to find the snippet's _id, groupId, and dateUpdated, then call update_snippet with snippetId set to that _id. Use get_snippet if you need to read the full content first.
IMPORTANT: When presenting results to the user, show only the abbreviation and content. Never display internal IDs (_id, groupId) 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%, %delay:N% (N = pause in milliseconds, 1–5000), %optional-begin:Label%, %optional-begin:Label:included%, %optional-end%, %conditional-begin:Label%, %conditional-begin:Label:N% (N = default branch index), %branch:BranchName%, %conditional-end%
%delay:N% inserts an expansion pause of N milliseconds (clamped to 1–5000) between the surrounding content — useful before a %key% keystroke, e.g. type a value, %delay:500%, then %key:tab%.
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.
Script snippets: to create an executable script snippet, pass snippetType 4 (JavaScript), 2 (AppleScript), or 3 (Shell Script), with content set to the raw script source. The source is stored verbatim: markdown is NOT parsed and TextExpander macros (%fill%, %date%, etc.) do NOT expand — every character, including %, **, and [], is kept literal — and the snippet's content type is set so it runs on expansion. Use these types only when the user asks for a JavaScript/AppleScript/Shell script snippet; for ordinary text leave snippetType unset (defaults to plain/formatted text). Do not wrap script source in markdown code fences.
Rich styling: 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 way to set styling markdown can't express (font, size, color, bulleted/numbered lists, tables); plain markdown content only produces bold/italic/link styling.
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.
add_snippet