MarkIndex
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
MarkIndex manages the user's library of long Markdown documents (manuals, specs, notes, knowledge bases). Every document is indexed as a tree of sections (nodes) addressed by line ranges in the original file.
DOCUMENT DISCOVERY:
browse_documents() — DEFAULT discovery tool, first choice for any document-related question. The bare call returns the library root's folders and documents with titles and descriptions; drill into folders whose names match the user's intent.
search_documents() — escalation path: use it when browsing and reading structures stalls, or to locate an exact term, name or identifier.
DECISION:
"What do I have / list / what's in folder X" → browse_documents()
ANY question that needs a document to answer → browse_documents(), pick the documents whose path/title/description matches, then read them
Reading a document: call get_document() first. If read_structure_first is true (over 15000 tokens), call get_document_structure() and read only the relevant nodes with get_node_content(); otherwise you may read its top-level nodes directly.
Prefer the most specific (leaf) nodes: reading a parent returns all of its subsections.
Skip discovery ONLY for questions with NO possible document connection (e.g., "capital of France").
After discovery: 1 match or 1 clearly best match → proceed to read and answer without asking. Multiple equally relevant → ask user to pick.
PERSISTENCE (before concluding the answer is not in the library): Applies both when results are empty AND when returned results do not clearly match the user's intent — treat a mismatch as "not found". Do NOT give up after a single attempt. Follow these steps in order:
browse_documents() level by level and compare every folder and document against the user's intent
Read the structure of the most plausible documents and follow promising sections
search_documents() with the key terms, then again with synonyms, alternative terms or the other language (Chinese/English)
Page through the ENTIRE folder with
limit: 50andoffset: next_offsetuntil has_more is false — MANDATORY before concluding "not found" Only after ALL steps have been tried may you conclude the answer is not in the library. Do NOT fall back to general knowledge — if the user's question references their own documents, exhaust every discovery path first.
GROUNDING AND CITATIONS:
Answer only from content read with get_node_content(); never fill a gap from general knowledge. When the documents do not answer the question, say so.
Cite every supported claim right after it as [doc_path, L-], using the line numbers shown in the content (e.g. [guides/setup.md, L120-134]). Cite the narrowest range that supports the claim; use separate references for separate ranges.
TOOL USAGE RULES:
Invoke a tool only when all required parameters are present or clearly inferable. Never invent placeholder values.
Copy doc_path, folder and node_id values verbatim from earlier tool results; never construct or guess them.
If a node_id is reported unknown, the document was re-indexed: call get_document_structure() again and use the new ids.
If a tool returns an error, follow the provided next_steps/options (or present them to the user) instead of retrying blindly.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| browse_documentsA | Primary discovery tool for the Markdown library. The bare call lists the library root: its sub-folders and the documents directly inside it (path, title, description, tokens). Pass |
| get_documentA | Get one document's metadata: title, description, frontmatter, size (lines, tokens) and |
| get_document_structureA | Get a document's section outline — node_id, title, line range, tokens, summary — without body text. REQUIRED for documents over 15000 tokens: call this first to locate the relevant sections, then read them with |
| get_node_contentA | Read the original Markdown of one or more nodes, every line prefixed with its line number in the file ("123│ "). Reading a node returns its whole line range INCLUDING all of its subsections, so prefer the most specific (leaf) nodes for precision and read a parent only when you need the entire section. Copy each |
| search_documentsA | Keyword (BM25) search over section titles, summaries and text, with a substring fallback; handles mixed Chinese/English text and identifiers such as "C++" or "ISO-27001". Returns matching nodes (doc_path, node_id, title_path, line range, snippet). Escalation path: use it when browsing folders and reading structures has not located the answer, or to find an exact term; scope it with |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool maps to a distinct step in a read-only workflow: folder browsing, document metadata, section outline, node content, and keyword search. The descriptions explicitly state the escalation order (browse before search, structure before reading large docs), so even the adjacent pair get_document/get_document_structure is clearly separated by 'metadata' vs 'outline'.
All names follow a snake_case verb_noun pattern (browse_documents, get_document, get_document_structure, get_node_content, search_documents). The verbs are meaningful and the noun targets (documents/document/node) are used consistently.
Five tools is tightly scoped for a read-only Markdown library: discovery, inspection, outlining, reading, and search. No tool appears redundant and none feels like it is missing from the minimal set.
The read lifecycle is fully covered with no dead ends: browse, check metadata, get structure, read content, and search, with pagination handled throughout. Minor gaps exist for a document library — no frontmatter/tag-based filtering or cross-document listing beyond folders, and no way to read a whole small document in one plain-text call without walking nodes.