Skip to main content
Glama
triliumnext-mcp

triliumnext-mcp

by perfectra1n

Create note

create_note

Create a note under an existing parent note, with HTML or Markdown content plus optional images and files, and get back the note, branch, and URL for sharing.

Instructions

Create a note under an existing parent and return the note, its branch and a url. Pick the parent with search_notes/get_note_tree; use "root" only for genuinely top-level notes. Text content is HTML or markdown (format="markdown"). Images/files can be uploaded and embedded in the same call (see the images/files fields). Give the user the returned url.

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": {
      "parentNoteId": "<parentNoteId>",
      "title": "<title>",
      "type": "<type>",
      "content": "<content>"
    },
    "name": "create_note"
  }
}

Input Schema

NameRequiredDescriptionDefault
mimeNoMIME type (required for code, file, image notes). Examples: application/javascript, text/x-python, text/markdown. For runnable scripts use application/javascript;env=frontend (browser) or application/javascript;env=backend (server). canvas/mindMap use application/json; render notes use an empty mime.
typeYesType of the note. For runnable scripts, render notes, or widgets, see the server instructions for the required mime and the follow-up set_attribute wiring that makes them work.
filesNoFiles to upload as attachments of this note and link as downloads. Reference entry N with <a href="file:N">label</a> (HTML, double quotes) or [label](file:N) (markdown); same indexing rules as images. Unreferenced files are appended as download links. To link an existing attachment use <a href="api/attachments/{attachmentId}/download">label</a>.
titleYesTitle of the new note
formatNo"markdown" converts content to HTML before saving. Applies to type="text" only; ignored for other types.html
imagesNoImages to upload as attachments of this note and embed. Reference entry N from the content with <img src="image:N"> (HTML, double quotes) or ![alt](image:N) (markdown); N indexes THIS array only, not attachments from earlier calls. Unreferenced images are appended at the end; an unresolved placeholder fails the call. To embed an existing attachment use its real URL: <img src="api/attachments/{attachmentId}/image/{filename}">. Images and files together may total at most the server's per-input content limit; add more with create_attachment.
noteIdNoForce a specific note ID (for imports/migrations). Must be 4-32 alphanumeric chars.
prefixNoBranch-specific title prefix (e.g., "Archive:", "Draft:")
contentYesNote body. Text notes: HTML, or markdown with format="markdown"; code blocks as <pre><code class="language-X">...</code></pre> (class on <code>). Code/mermaid/canvas notes: the raw source. Binary notes (file/image with a binary mime): a path, URL, data URL or base64, in the forms images[].data accepts. Link to another note with <a href="note:TARGET_NOTE_ID">text</a> (HTML) or [text](note:TARGET_NOTE_ID) (markdown): the server rewrites it into a real Trilium reference link and rejects unknown IDs; empty link text becomes the target title. Hand-written #root/... anchors are stored as inert links.
branchIdNoForce a specific branch ID (for imports/migrations). Must be 4-32 alphanumeric chars.
isExpandedNoWhether this note (as a folder) should appear expanded in the tree
dateCreatedNoSet creation date for backdating. Format: "2024-01-15 10:30:00.000+0100"
notePositionNoPosition in parent (10, 20, 30...). Use 5 for first position, 1000000 for last
parentNoteIdYesID of an existing parent note (find one with search_notes/get_note_tree); use "root" only for genuinely top-level notes.
utcDateCreatedNoSet UTC creation date. Format: "2024-01-15 09:30:00.000Z"
utcDateModifiedNoSet the UTC last-modified date (e.g. to keep the original date of a note migrated from another app). Format: "2024-01-15 09:30:00.000Z". Needs a Trilium newer than 0.105 (older ones reject it).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.4.0
    • changedInput schema / properties / content / description
      Previous value: -"Content of the note. For text notes: provide HTML (default) or markdown (if format is \"markdown\"). For code notes: provide raw code. For binary notes (file/image types with a binary mime): provide base64, a data URL, a local file path, or an http(s) URL — auto-detected. For code blocks in HTML, use <pre><code class=\"language-X\">...</code></pre> structure (e.g., language-mermaid, language-javascript). The class must be on the <code> element, not <pre>. Internal links to other Trilium notes: write <a href=\"note:TARGET_NOTE_ID\">Link text</a> in HTML, or [Link text](note:TARGET_NOTE_ID) in markdown — the server turns it into a proper Trilium reference link (class=\"reference-link\" + href/data-note-path built from the target's tree path) and rejects the write if the target does not exist. Leave the link text empty to use the target's title. Do NOT write [text](#root/...) markdown links or hand-built anchors without class=\"reference-link\" and data-note-path — Trilium stores those as inert hash anchors, not note links."New value: +"Note body. Text notes: HTML, or markdown with format=\"markdown\"; code blocks as <pre><code class=\"language-X\">...</code></pre> (class on <code>). Code/mermaid/canvas notes: the raw source. Binary notes (file/image with a binary mime): a path, URL, data URL or base64, in the forms images[].data accepts. Link to another note with <a href=\"note:TARGET_NOTE_ID\">text</a> (HTML) or [text](note:TARGET_NOTE_ID) (markdown): the server rewrites it into a real Trilium reference link and rejects unknown IDs; empty link text becomes the target title. Hand-written #root/... anchors are stored as inert links."
    • changedInput schema / properties / files / description
      Previous value: -"Optional array of files to attach and embed as download links in the note. The data field accepts a local file path, an http(s) URL, a data URL, raw base64 (binary types), or raw text (text types) — auto-detected; mime and filename are optional. Reference files in your content using placeholder URLs: in markdown use [label](file:0), [label](file:1), etc. In HTML use <a href=\"file:0\">label</a> (double quotes required). The number is the zero-based index into THIS array — placeholders do NOT reference attachments uploaded in earlier calls. Files and placeholders must be provided together in the same call. Files without a corresponding placeholder are appended at the end of the content as download links. To reference an attachment you uploaded separately, use its real URL: <a href=\"api/attachments/{attachmentId}/download\">label</a>."New value: +"Files to upload as attachments of this note and link as downloads. Reference entry N with <a href=\"file:N\">label</a> (HTML, double quotes) or [label](file:N) (markdown); same indexing rules as images. Unreferenced files are appended as download links. To link an existing attachment use <a href=\"api/attachments/{attachmentId}/download\">label</a>."
    • changedInput schema / properties / files / items / properties / data / description
      Previous value: -"The file. Pass any of: a local file path (\"/abs/path\" or \"~/path\"), an http(s) URL, a data URL (data:image/png;base64,...), or inline base64 (binary types) / raw text (text types) — the source is auto-detected. Use a file:// prefix to force path interpretation."New value: +"The file, in any of the forms images[].data accepts."
    • changedInput schema / properties / files / items / properties / filename / description
      Previous value: -"Optional filename for the file attachment (e.g., \"report.pdf\"). Defaults to the path/URL basename, else file-N."New value: +"Attachment filename (e.g. \"report.pdf\"). Defaults to the path/URL basename, else file-N."
    • changedInput schema / properties / files / items / properties / mime / description
      Previous value: -"Optional MIME type (e.g., \"application/pdf\", \"text/csv\") — auto-detected from the source; set only to override."New value: +"MIME type override (e.g. \"application/pdf\"); normally auto-detected."
    • addedInput schema / properties / files / maxItems
      Added value: +50
    • changedInput schema / properties / format / description
      Previous value: -"Content format for text notes. Use \"markdown\" to automatically convert markdown to HTML. Defaults to \"html\". Only applies to text notes."New value: +"\"markdown\" converts content to HTML before saving. Applies to type=\"text\" only; ignored for other types."
    • changedInput schema / properties / images / description
      Previous value: -"Optional array of images to embed in the note. The data field accepts a local file path, an http(s) URL, a data URL, or raw base64 — auto-detected; mime and filename are optional. Reference images in your content using placeholder URLs: in markdown use ![alt](image:0), ![alt](image:1), etc. In HTML use <img src=\"image:0\"> (double quotes required). The number is the zero-based index into THIS array — placeholders do NOT reference attachments uploaded in earlier calls. Images and placeholders must be provided together in the same call. Images without a corresponding placeholder are appended at the end of the content. To reference an attachment you uploaded separately, use its real URL: <img src=\"api/attachments/{attachmentId}/image/{filename}\">."New value: +"Images to upload as attachments of this note and embed. Reference entry N from the content with <img src=\"image:N\"> (HTML, double quotes) or ![alt](image:N) (markdown); N indexes THIS array only, not attachments from earlier calls. Unreferenced images are appended at the end; an unresolved placeholder fails the call. To embed an existing attachment use its real URL: <img src=\"api/attachments/{attachmentId}/image/{filename}\">. Images and files together may total at most the server's per-input content limit; add more with create_attachment."
    • changedInput schema / properties / images / items / properties / data / description
      Previous value: -"The image. Pass any of: a local file path (\"/abs/path\" or \"~/path\"), an http(s) URL, a data URL (data:image/png;base64,...), or inline base64 (binary types) / raw text (text types) — the source is auto-detected. Use a file:// prefix to force path interpretation."New value: +"The image. Pass any of: an http(s) URL, a data URL (data:image/png;base64,...), or inline base64 (binary types) / raw text (text types) — the source is auto-detected. A file path (\"/abs/path\", \"~/path\", or file://...) refers to the MCP SERVER's filesystem and only works when the server permits local file reads."
    • changedInput schema / properties / images / items / properties / filename / description
      Previous value: -"Optional filename for the image attachment (e.g., \"screenshot.png\"). Defaults to the path/URL basename, else image-N."New value: +"Attachment filename (e.g. \"chart.png\"). Defaults to the path/URL basename, else image-N."
    • changedInput schema / properties / images / items / properties / mime / description
      Previous value: -"Optional MIME type (e.g., \"image/png\") — auto-detected from the source; set only to override."New value: +"MIME type override (e.g. \"image/png\"); normally auto-detected."
    • addedInput schema / properties / images / maxItems
      Added value: +50
    • changedInput schema / properties / parentNoteId / description
      Previous value: -"ID of the parent note. Before choosing a parent, use search_notes and get_note_tree to explore the existing note hierarchy and find the most appropriate location. Only use \"root\" when the note truly belongs at the top level — most notes belong under an existing section or folder."New value: +"ID of an existing parent note (find one with search_notes/get_note_tree); use \"root\" only for genuinely top-level notes."
    • addedInput schema / properties / parentNoteId / maxLength
      Added value: +128
    • addedInput schema / properties / parentNoteId / pattern
      Added value: +"^[A-Za-z0-9_]+$"
  2. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare the mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the bar is lower. The description adds genuine value beyond that: it discloses the return payload (note, branch, url) in the absence of an output schema, and tells the agent to surface the url to the user. It does not cover failure modes or side effects at the top level (e.g., duplicate titles, unresolved image placeholders), which live only in the schema field text.

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

Conciseness4/5

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

Front-loaded with purpose and return value, then parent guidance, then content/attachment notes. Every sentence carries useful information; the only marginal line is the imperative to hand the user the returned url, which is still actionable for an agent.

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

Completeness4/5

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

For a 16-parameter creation tool with no output schema, the description covers the essentials an agent needs before calling: purpose, parent choice, content format, inline attachment support, and return value. Remaining details (mime rules, date fields, position, id forcing) are well documented in the schema, so the gaps are minor.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description reinforces a few high-stakes semantics (parent selection, content being HTML or markdown via format="markdown", and the images/files fields), but this largely duplicates what the schema already states in more detail.

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 opens with a specific verb and resource plus the return shape ("Create a note under an existing parent and return the note, its branch and a url"), which lets an agent distinguish it from read-side siblings like get_note or search_notes. It does not explicitly differentiate from the write/edit sibling write_note, so the create-vs-update boundary is left to be inferred.

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

Usage Guidelines4/5

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

It gives concrete routing guidance for the key decision: choose the parent via search_notes/get_note_tree, and reserve "root" for genuinely top-level notes. It also points to create_attachment for content beyond the per-input limit. What is missing is explicit guidance on when to use this versus write_note (e.g., for existing notes).

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