agentleFS
MarceltovMarceltov/trilium-plugin/skills/search-notes/SKILL.md

search-notes

Skill0 starsChanged 2 months agoMITView on GitHub

Search for Trilium notes by title, content, or attributes using the searchNotes MCP tool and Trilium's query syntax. Use when the user asks to find, search for, list, or look up notes — general lookups, not specifically notes derived from a template (use find-template-instances for that).

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If more than one Trilium instance is connected this session, resolve which one to use first — see Working with multiple instances.

    line 17
  2. Distinctive:

    Clarify what the user is looking for: if it's ambiguous: a keyword search, a label/attribute filter, a relation filter, or some combination.

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Search Trilium Notes

A thin wrapper around searchNotes, which takes a query string in Trilium's own search syntax (https://triliumnext.github.io/Docs/Wiki/search.html) — the same syntax used in Trilium's UI search box. For searching specifically by template relationship, use the find-template-instances skill instead, which covers that syntax in more depth.

Query syntax basics

  • Plain words do a fulltext search over titles (and content, unless fastSearch is set): project plan
  • #labelName matches notes carrying that label; #labelName = 'value' matches an exact value; other comparators (*=*, >=, <=, etc.) work per the syntax doc.
  • ~relationName.title = 'X' or ~relationName.noteId = 'id' matches notes whose relation points at a note with that title/id.
  • Combine clauses with AND/OR, and scope with note.type, note.dateCreated, etc. — see the syntax doc for the full grammar rather than guessing at an unfamiliar clause.

If more than one Trilium instance is connected this session, resolve which one to use first — see Working with multiple instances.

Steps

  1. Clarify what the user is looking for if it's ambiguous: a keyword search, a label/attribute filter, a relation filter, or some combination. Don't invent a query more specific than what they asked for.
  2. Compose the search string from the query syntax above. Prefer the simplest query that captures the request — a bare keyword search over content unless the user names labels, relations, or a specific note type.
  3. Call searchNotes with search: <query>. Consider:
    • limit if the user wants only the top N results.
    • ancestorNoteId (+ ancestorDepth) if the user wants to search only within a subtree.
    • fastSearch: true if the user explicitly wants title/attribute-only matching without scanning content (faster, less thorough).
    • orderBy/orderDirection if the user wants a particular sort.
    • includeArchivedNotes: true only if the user asks to include archived notes — they're excluded by default.
  4. If zero results come back and the query used a label/relation filter, don't just report "nothing found" — consider whether the attribute name might be slightly different than assumed, and say so rather than guessing at variations silently.
  5. Present results concisely: title, noteId, and whichever attribute values are relevant to what the user asked about — not the full JSON payload per note.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.