---
name: trilium
description: Interface with Trilium Notes to search, read, create, and update notes. Use when the user wants to manage their personal knowledge base, retrieve information from Trilium, or save new thoughts and snippets.
---
# Trilium Notes Skill
This skill enables seamless interaction with Trilium Notes, a
hierarchical note-taking application. It allows you to search for
notes, retrieve their content and metadata, and create or update notes
directly from the CLI.
Note that the MCP server associated with this skill requires the
following environment variables:
* `TRILIUM_URL`, the URL of the Trilium server
* `TRILIUM_TOKEN`, the API key of the Trilium server
## Core Capabilities
### 1. Searching Notes
Use `search_notes` to find notes using Trilium's powerful search syntax.
- **Simple search**: `search_notes(query="React")`
- **Attribute search**: `search_notes(query="#todo")`
- **Full-text search**: `search_notes(query="content *= 'project plan'")`
### 2. Reading Notes
Retrieve the content and structure of your knowledge base.
- **Get content**: Use `get_note_content(noteId="...")` to read the HTML content of a note.
- **Get metadata**: Use `get_note_metadata(noteId="...")` to see tags, attributes, and creation dates.
- **List children**: Use `get_note_children(noteId="...")` to explore the hierarchy. The root note ID is `root`.
### 3. Modifying Notes
Keep your notes up to date or capture new information.
- **Create note**: Use `create_note(title="...", content="...", parentNoteId="root")` to add new entries.
- **Update content**: Use `update_note_content(noteId="...", content="...")` to modify existing notes.
## Workflow Examples
### Researching a Topic
1. **Search**: `search_notes(query="Machine Learning")` to find relevant notes.
2. **Read**: `get_note_content(noteId="...")` for the most promising results.
3. **Explore**: `get_note_children(noteId="...")` if the note is a folder/parent.
### Capturing Meeting Notes
1. **Find Parent**: `search_notes(query="Meetings")` to find where to put the new note.
2. **Create**: `create_note(title="Sync 2024-05-20", content="<p>Discussed project roadmap...</p>", parentNoteId="...")`.
### Updating a Todo List
1. **Search**: `search_notes(query="title = 'Todo List'")`.
2. **Read**: `get_note_content(noteId="...")` to see current state.
3. **Update**: `update_note_content(noteId="...", content="...")` with the new list.
## Notes on HTML Content
Trilium stores notes as HTML. When creating or updating notes, ensure the content is wrapped in appropriate HTML tags (e.g., `<p>`, `<ul>`, `<li>`) for best rendering in the Trilium UI.
**Important formatting rules:**
1. **Do NOT** include the note's title inside the HTML content (e.g., as an `<h1>`). Trilium displays the title separately at the top of the UI.
2. Use semantic tags for sections, but start from `<h2>` or below if sub-headers are needed.
## Templates and Attributes
You can create notes that inherit from a specific template and set attributes in a single call.
- **Template**: Use `templateNoteId` in `create_note`.
- **Attributes**: Use the `attributes` array in `create_note` or `create_attribute` separately for setting labels and relations.