Tools Overview
Linkly AI exposes three tools to AI assistants via MCP (Model Context Protocol), forming a progressive document access workflow:search
Search documents and find relevant results
outline
View document outlines to understand structure
read
Read document content for detailed information
Search
Searches indexed local documents and returns a list of the most relevant results.Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Search keywords or phrase |
limit | number | No | 20 | Maximum number of results (1-50) |
doc_types | string[] | No | All | Filter by document type, e.g. ["pdf", "md", "docx"] |
output_format | string | No | markdown | Set to json for structured JSON output |
Response Fields
Each search result contains the following information:| Field | Description |
|---|---|
doc_id | Unique document identifier for subsequent outline/read calls |
title | Document title |
path | File path |
relevance | Relevance score (0-1) |
word_count | Document word count |
total_lines | Total number of lines in the document |
has_outline | Whether an outline is available |
modified_at | Last modified time |
keywords | Extracted keyword list |
snippet | Matching content snippet |
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
doc_ids | string[] | Yes | — | List of document IDs (from search results) |
expand | string[] | No | Auto | Node IDs to expand (e.g. ["2", "3.1"]); omit to automatically show all levels |
output_format | string | No | markdown | Set to json for structured JSON output |
When to Use Outline
| Scenario | Recommendation |
|---|---|
| Long document (> 200 lines) with outline | View outline first, then read target sections |
| Short document (< 100 lines) | Skip outline, read full text directly |
Document with has_outline: false | Skip outline, read page by page |
The outline feature works best with bookmarked PDFs, Markdown, and
DOCX documents. It is especially effective when reading lengthy documents
and books. Outline support for plain text and unbookmarked PDFs will be added
in future iterations.
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
doc_id | string | Yes | — | Document ID (from search results) |
offset | number | No | 1 | Starting line number (from 1) |
limit | number | No | 200 | Number of lines to read (max 500) |
output_format | string | No | markdown | Set to json for structured JSON output |
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
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:
| Format | Extensions | Outline Support |
|---|---|---|
| Markdown | .md, .mdx | Yes |
| Word | .docx | Yes |
.pdf | Partial | |
| Plain Text | .txt | No |
| HTML | .html, .htm | Partial |
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

