Tools Overview
Linkly AI exposes nine tools to AI assistants via MCP (Model Context Protocol); the cloud gateway (mcp.linkly.ai, and linkly mcp --remote) adds two cloud-only tools — library_search and library_link — for eleven in total there. At the core is a progressive document access workflow:
list_libraries (list knowledge libraries), explore (overview of document collections), find_paths (locate folder paths by keyword to feed search’s path_glob) — plus list (enumerate a container: a folder’s files, a library, or your notes) and the one note tool: note_save (create / edit a note).
search
Search documents and find relevant results
outline
View document outlines to understand structure
grep
Find specific text patterns with regex matching
read
Read document content for detailed information
list_libraries
List knowledge libraries and their document counts
explore
Overview of document collection themes and structure
find_paths
Locate folder paths by keyword to feed
search’s path_globlist
List the entries inside a container — a folder, a library, or your notes
note_save
Create or edit a note — writes (the only writer on a local connection)
library_search
Search the cloud library catalog, including libraries you haven’t linked yet — cloud gateway only
library_link
Link a cloud library so it becomes searchable, or unlink one you named (
action: "unlink") — cloud gateway only, writeslibrary_search and library_link exist only on the cloud gateway. library_link is the tool that writes there: it adds a cloud library to your account’s linked set, or with action: "unlink" removes one you named. Everything else below reads only.note_save — and, on the cloud gateway, library_link — is read-only: they read your documents and never modify anything. note_save can only write into the notes folder, and there is no delete tool: deleting a note is something only you can do, in the app.
Search
Searches indexed local documents and returns a list of the most relevant results.Parameters
About time filtering and sorting:
- When the user gives an explicit window (“last month”, “in 2024”, “in the last three months”), use
modified_after/modified_before. - When the user only says “recent”, “latest”, “earliest” without a fixed window, use
time_sort=newestoroldest. - The two can combine: “earliest in 2024” is
modified_after=2024-01-01+modified_before=2024-12-31+time_sort=oldest. - For relative dates (“last month”), first read the current UTC time from the
[meta] now=...field at the end of any tool response, then compute the date — see Response Metadata below.
Response Fields
Each search result contains the following information:Usage Examples
Outline
Retrieves the structured outline and metadata of one or more documents, helping to quickly understand document structure and locate target sections.Parameters
When to Use Outline
The outline feature works best with bookmarked PDFs, Markdown, DOCX, DOC, PowerPoint (PPTX), XLSX, CSV, EPUB, and RTF documents. It is especially effective when reading lengthy documents and books. For spreadsheets the outline lists tables rather than headings: an XLSX workbook gets one entry per worksheet (with its row and column counts, header row, and a few preview rows), and a CSV file gets a single table summary entry. Outline support for plain text and unbookmarked PDFs will be added in future iterations.
Usage Examples
Grep
Locate specific lines within a single document by regex pattern. Best for documents withhas_outline=false where outline is unavailable. Use after search to pinpoint exact positions of names, dates, terms, identifiers, or any pattern — then use read with offset to see full context. Works on all document types (PDF, Markdown, DOCX, DOC, PPTX, XLSX, CSV, EPUB, RTF, TXT, HTML). For searching across multiple documents, call grep once per document.
Parameters
When to Use Grep vs Outline
Usage Examples
Read
Reads document content with line number positioning and pagination, suitable for reading specific parts of long documents. The Read tool behaves consistently with the Claude AI SDK, ensuring optimal results across various Agentic AI models.Parameters
Reading documents with images
In many documents — Markdown notes and technical docs especially — the key information lives in the figures.read resolves the image references that appear within the line range you are reading into their corresponding indexed image documents and attaches them at the end of the result. image_text controls how much is attached:
full has a budget: 2,000 characters per image and 20,000 characters per call in total. Images that exceed the budget are automatically downgraded to abstract, along with guidance on how to read them individually.
Content Format
TheRead tool returns content with line numbers for easy reference and positioning:
Pagination Strategy
For long documents, it is recommended to read in chunks:read to precisely retrieve the content within that range.
Usage Examples
List Libraries
Lists the knowledge libraries that are searchable right now — local libraries and cloud libraries already linked — along with their descriptions and document counts. A cloud library you have not linked yet is not listed: uselibrary_search to find it and library_link to link it.
Parameters
No parameters required.Use Cases
- When the user asks “what libraries do I have?”
- Before using the
libraryparameter insearch, to verify a library name
Search Libraries (library_search)
Cloud gateway only — available on the
linkly-ai-cloud MCP server and linkly mcp --remote. Local and LAN connections do not have this tool.search. To see what is already searchable, use list_libraries.
Parameters
Response
Each entry carries the exactcloud://<owner>/<slug> to pass to other tools, plus title, description, owner, category, visibility, document / star / link counts, is_owner, is_linked (already searchable — no need to link again) and can_link (with cannot_link_reason: invite_required for a Showcase library you were not invited to). Public and Showcase libraries are always listed; Private libraries appear only to their owner and invited readers. Results are ordered by last update, newest first. The tool never links, stars or changes anything.
Use Cases
- “Find a knowledge base about Rust and use it” →
library_search(query="Rust")→ pick a result →library_link→search(query=…, library="cloud://…") - “Which cloud libraries do I own?” →
library_search(owner="<your username>")
Link Library (library_link)
Cloud gateway only; one of the two tools that write (the other is
note_save). The same tool unlinks with action: "unlink" — see below.list_libraries immediately and search / explore / list accept its cloud://<owner>/<slug> right away. Same rules as the Link button on the website.
Parameters
Rules
- Public libraries: anyone signed in can link. Showcase and Private libraries: only the owner and invited readers (the tool answers
invite_required, or “not found” for a private library you cannot see). - Linking the same library twice is harmless — it answers
already_linkedwithout using another Slot. - Every link uses one Slot (Free: 1, Pro: 99). When the quota is full the tool answers
slot_exhaustedwith the current count, the limit and an upgrade link. The assistant must not pick a library to unlink on its own: it lists your linked libraries and asks which one to release, then callslibrary_linkwithaction: "unlink"and links again. You can also free a Slot on the website.
Unlink (action: "unlink")
Removes a cloud library from your account’s linked set: it disappears from list_libraries, stops being searchable through MCP (for every client of your account), and its Slot is freed. Nothing else changes — your reader access, invitation and star stay, so the library can be linked again later. Same library parameter, exactly as listed by list_libraries.
- The assistant unlinks only a library you named — typically “replace A with B” when the Slot is full. If you have not named one, it lists your linked libraries and asks; it never picks one itself.
- Unlinking a library that is not linked is harmless — it answers
already_unlinked.not_foundmeans no such library is visible to your account. - The response reports the Slots still used, so the assistant can link the library you actually wanted right after.
Explore
Get a bird’s-eye overview of all indexed documents or a specific library. Returns document type distribution, directory structure (with file counts and median word counts), and top keywords (with source attribution).Parameters
Use Cases
- The user wants to know what’s in their knowledge base or document collection
- The user doesn’t have a specific search topic and wants to discover available themes and directions
- The AI assistant needs to understand the scale and topic distribution to formulate effective search strategies
search queries.
Find Paths (find_paths)
Fuzzy-matches keywords against the file path field of indexed documents, aggregates matches at folder granularity, and returns the top folder candidates. It is positioned as a helper forsearch: when the user names a container (“in my Notion notes”, “in my Dropbox papers folder”) but you don’t know its on-disk path, call find_paths first to discover the real path, then pass it as path_glob to search.
The actual folder name on disk often differs from the user’s spoken name (e.g. an export might live under Notion-Export-c58e430f... rather than just Notion), so guessing a path_glob directly is fragile.
Parameters
Response Fields (JSON mode)
Aggregation behaviour
- Files whose patterns only match the filename segment (no matching directory segment) are silently dropped — this is a “find folders” tool, not a “find files” tool. If a query yields zero candidate folders even though matching files exist, fall back to calling
searchdirectly. - Each match is bucketed by the shallowest position of any pattern in the path, truncated at the next
/. Solocal:///Users/me/Documents/Notion-Export-abc/workspace/page.mdmatched byNotionaggregates under.../Documents/Notion-Export-abc, regardless of how deep the file lives.
When to use
- The user names a container with a fuzzy or cross-language word (“in my Notion notes”, “in my Dropbox papers folder”, “in my work backup”) and you don’t know the actual path
- Call before
searchto determine the rightpath_glob
When not to use
- Pure content / topic queries (“find resumes”, “find AI papers”) — call
searchdirectly; its hybrid retrieval already covers title, filename, content, and path - Filter by file type only (“all PDFs”) — call
searchwithpath_glob="*.pdf"directly - Vague queries with no container intent (“find recent stuff”) — call
search
Usage example
List (list)
Lists the entries inside a container. It does no full-text matching — to find content by keyword or meaning, usesearch. Three container scopes are supported: folder (indexed files under a disk directory), library (one library’s files), and notes (local card notes).
Tool boundaries: explore = global overview → find_paths = find a directory → list = list the files of a known container → outline / read = read content. Listing is a flat recursive sweep of the whole subtree — no directory tree is returned; drill down via the absolute paths in the entries, or via find_paths.
Parameters
Response Fields
folder / library entries carry: doc_id, title, absolute path, doc_type, word_count, total_lines, has_outline, modified_at (Unix milliseconds; the filesystem mtime), keywords, snippet (null unless snippets are enabled), and skip_reason — a non-null skip_reason means the content is not readable, so don’t read / grep it. Use total_lines + has_outline to decide between outline and read. For local scopes total counts the whole filtered set; a cloud library may return total: null when the full count is unknown — either way, page with offset + has_more.
notes entries carry: doc_id (hand it to read / grep / outline), note_id and a live version (the two optimistic-locking credentials note_save needs when editing), title, absolute path, created_at / modified_at (Unix milliseconds), tags, source information, and the snippet attached by default. The response also includes available_tags — the 50 most frequently used tags across all your notes, ready to drop straight into the tags filter of the next call.
README pointer: when you list with an explicit
path (scope folder or a local library) and a README-style file sits directly in that directory (not in a subdirectory), the response carries a top-level readme pointer. Cloud libraries never return one. When it’s present and you need to understand what the folder is for, read that document first.Filesystem first (notes): a note you just wrote shows up in the list immediately, but at that point its
doc_id is null and indexed is false (word and line counts are still empty too) until indexing catches up. So “the note I just wrote is listed but not searchable” is expected behaviour, not a lost note.title can also be null — notes with machine-generated filenames have no usable title, so identify them by the excerpt, tags, and timestamps.Cloud libraries
folder addresses local disk paths only. To list a cloud library, use scope="library" with library="cloud://<owner>/<slug>" (available with --remote), and pass path as a relative directory prefix — exactly the form cloud find_paths returns. The prefix applies across all of the library’s sources; a prefix that doesn’t exist can’t be distinguished from an empty directory — on the first page (offset=0) both come back as total: 0, with a hint when a path was passed.
Cloud listing differs from local in a few ways: sort="name" is not supported, skip_reason is always null, snippets are capped at roughly 120 characters, and total may be null beyond the first page — paginate with has_more.
Usage Examples
Save Note (note_save)
Creates or edits a local Markdown card note. Together withlibrary_link (cloud gateway only) this is one of the two tools that write, and it can only write into the notes folder. All YAML metadata is generated server-side, so callers don’t need to deal with it.
Parameters
Two rules you have to know
The body format is an allowlist, not free-form Markdown
The body format is an allowlist, not free-form Markdown
This path only accepts the subset of Markdown that the editor’s toolbar can produce: paragraphs and line breaks, bold, strikethrough, ordered and unordered lists, and plain text.Headings, italics, blockquotes, code, links, tables, task lists, images, and raw HTML are rejected with
NOTE_INVALID_INPUT. Writing by hand in the app’s editor is not subject to this restriction.Inline #tags in the body (outside code) are the note’s tags — the body is the single source of truth, same as writing in the app’s editor. Remove a tag by deleting its #token; the tags parameter can only add. Notes written by older versions with tags only in the YAML heal themselves: the first AI edit appends the missing #tokens to the body.Editing must go through the optimistic-lock (CAS) loop
Editing must go through the optimistic-lock (CAS) loop
The correct edit sequence is:
list(scope="notes") to getnote_idandversionread(doc_id)to get the current complete bodynote_savewithmode="edit",note_id,base_versionset to the version you just read, and the full revised body — keep the#tagtokens you want to keep, delete one to remove that tag
base_version is stale (the note changed in the meantime), you get NOTE_VERSION_CONFLICT along with the real version number — re-read, merge, and retry. Do not blindly overwrite.Every success response returns the note’s effective content (the server may have appended #tokens) and its new version — base any follow-up edit on that returned content, never on what you sent. A note that hasn’t been indexed yet has a null doc_id, so this is also how you edit a note you just created. Never rewrite a whole note from its excerpt alone.Response Metadata
Every successful tool response carries the current UTC time so callers can compute relative dates (“last month”, “this year”, “in the last 30 days”) without relying on the model’s training cutoff.-
Markdown output: a footer block at the end of the response, formatted as:
-
JSON output: a top-level
_metaobject:
isError: true) do not include this metadata — the error body itself already conveys the cause, and adding a timestamp would only dilute the signal.
When the user uses a relative date, read now from the most recent tool response, compute the corresponding ISO 8601 date, and pass it to search’s modified_after / modified_before.
Workflow Examples
Complete Workflow: CLI Method
The following example demonstrates how to perform a complete document retrieval via CLI:Complete Workflow: MCP Method
When AI assistants call tools via the MCP protocol, the request format is as follows:FAQ
What document formats are supported?
What document formats are supported?
Linkly AI currently supports the following formats:
Excel and CSV files are parsed into GitHub-flavored Markdown tables and indexed by cell text, so
search and grep match the words inside individual cells. Outlines differ by format: an .xlsx workbook gets one entry per worksheet (with its row and column counts, header row, and a few preview rows), while a .csv file gets a single table summary entry. Only .xlsx and .csv are supported — the older .xls and the .xlsm, .xlsb and .ods variants are not. A CSV that is not UTF-8 is decoded only when its encoding can be determined from the file itself or from its neighbors in the same directory; when the encoding cannot be determined the file is skipped rather than indexed as garbled text. Both formats have a 16 MiB per-file limit.Speech transcription for audio and video is off by default — these files still get registered in the index (so filename search finds them), but to search what was said inside them you first need to turn on Audio transcription and Video transcription under Settings → Index. See Index Settings for details.What if an outline is not available?
What if an outline is not available?
If a document has no available outline (
has_outline: false), you can:- Use the
readtool directly to browse the document content page by page - Read the beginning of the document first (default 200 lines) to get a general idea, then decide whether to continue reading
How to handle long documents?
How to handle long documents?
Recommended workflow:
- First use
outlineto understand the document structure (if an outline is available) - Based on the line ranges in the outline, use the
offsetandlimitparameters ofreadto precisely read target sections - Read up to 500 lines at a time, and paginate by adjusting
offset
What is the default port for the MCP service?
What is the default port for the MCP service?
The default port is 60606. If that port is occupied, the application will automatically try other ports. You can check the actual port in use in Linkly AI Desktop’s settings.
What if search results are inaccurate?
What if search results are inaccurate?
You can try:
- Using more precise keywords
- Using natural language descriptions (leveraging vector semantic matching)
- Mixing keywords and synonyms, e.g.
"authentication auth login sign-in" - Using
--typeto filter specific document types and narrow the search scope

