Skip to main content
Glama
triliumnext-mcp

triliumnext-mcp

by perfectra1n

Backup, export, import, app info, or metrics

manage_system
Destructive

Inspect Trilium app/database versions and metrics, create or replace backups, and export/import note subtrees as ZIP archives for maintenance and migration.

Instructions

Trilium system operations, selected by "action":

  • "app_info" (read-only): Trilium app/database/clipper versions.

  • "metrics" (read-only): note, attachment, revision, branch and attribute counts and per-type breakdowns. Needs a Trilium version with /etapi/metrics.

  • "backup": write backup-.db to Trilium's data directory, replacing a backup with the same name.

  • "export": export a subtree as a ZIP (html, markdown or share format), returned as an embedded resource for the user to save (max 10 MB). You cannot read the ZIP contents — to read notes use get_note.

  • "import": import a base64 ZIP (e.g. a previous export) under noteId; returns the created note.

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": {
      "action": "<action>"
    },
    "name": "manage_system"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNoaction="import": the ZIP archive, base64-encoded. Only practical for small archives.
actionYesSystem action to perform; see the tool description for each action.
formatNoaction="export": "html" (default), "markdown", or "share" (static HTML site layout).html
noteIdNoaction="export": root of the subtree to export. action="import": parent note to import under.
backupNameNoaction="backup": backup file identifier (letters, digits, - and _); writes backup-<name>.db.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.4.0
    • changedInput schema / properties / action / description
      Previous value: -"System action to perform. \"backup\" — create a full database backup (fields: backupName). \"export\" — export a note and its subtree as a ZIP archive, returned base64-encoded (fields: noteId, format?). \"import\" — import a ZIP archive (e.g. from a previous export) under a parent note (fields: noteId, data). \"app_info\" — return Trilium instance info (version, database version) for diagnostics (no fields). \"metrics\" — note/attachment/revision/attribute counts and note-type breakdowns (no fields)."New value: +"System action to perform; see the tool description for each action."
    • changedInput schema / properties / backupName / description
      Previous value: -"Required for action=\"backup\": identifier for the backup file (alphanumeric, hyphens, underscores)."New value: +"action=\"backup\": backup file identifier (letters, digits, - and _); writes backup-<name>.db."
    • changedInput schema / properties / data / description
      Previous value: -"Required for action=\"import\": the ZIP archive as base64. Intended for small archives — base64 you can emit inline is the practical size limit."New value: +"action=\"import\": the ZIP archive, base64-encoded. Only practical for small archives."
    • changedInput schema / properties / format / description
      Previous value: -"Optional for action=\"export\": markdown is recommended for LLM processing (default: html)."New value: +"action=\"export\": \"html\" (default), \"markdown\", or \"share\" (static HTML site layout)."
    • changedInput schema / properties / format / enum
      Previous value: -[
      -  "html",
      -  "markdown"
      -]New value: +[
      +  "html",
      +  "markdown",
      +  "share"
      +]
    • changedInput schema / properties / noteId / description
      Previous value: -"Required for action=\"export\": note to export (use \"root\" to export the entire database). Required for action=\"import\": parent note to import the ZIP under."New value: +"action=\"export\": root of the subtree to export. action=\"import\": parent note to import under."
    • addedInput schema / properties / noteId / maxLength
      Added value: +128
    • addedInput schema / properties / noteId / minLength
      Added value: +1
    • addedInput schema / properties / noteId / pattern
      Added value: +"^[A-Za-z0-9_]+$"
  2. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, but the description adds real behavioral detail beyond them: backup silently replaces a same-named file, export is capped at 10 MB and cannot be read back, import returns the created note, and app_info/metrics are individually read-only despite the tool-level write flag. Auth/permission requirements and failure modes are not covered.

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

Conciseness5/5

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

The definition is front-loaded with the selecting parameter and organized as one bullet per action, so an agent can scan to the relevant branch. Every sentence carries actionable content (prerequisite, size cap, replacement behavior, return value) with no filler.

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 five-action mutation tool with no output schema, it states what import returns and that export comes back as an embedded resource, and covers the backup side effect. It leaves backup's return value and error behavior unspecified, a minor gap given the rest of the coverage.

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 all five parameters are already documented in the schema, including the action-conditional meanings of noteId, data, format and backupName. The description mostly restates those semantics (base64 ZIP under noteId, backup-<name>.db naming) rather than adding new meaning, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb+resource for every action in the enum: app_info returns app/database/clipper versions, metrics returns counts and breakdowns, backup writes backup-<backupName>.db, export produces a ZIP subtree, import creates a note under noteId. It also explicitly distinguishes itself from get_note for reading note contents, so an agent can pick the right tool without opening the schema.

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 clear situational context per action (read-only flags, the /etapi/metrics version prerequisite, import being a previous export) and explicitly routes the agent away from export to get_note for reading notes. It stops short of explicit when-not guidance for backup versus export, so it is clear context but not full exclusion logic.

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