Documentation notebook

Field guide for DocShark internals

Home / Docs / MCP Tools

MCP Tools Specification

DocShark exposes 4 MCP tools following the Six-Tool Pattern and MCP best practices.

Agent UX

Design intent

The tool set is intentionally narrow. Fewer, purpose-specific tools reduce model uncertainty and keep agent behavior predictable across clients.

Design Principles

  1. Tools are a UI for agents — designed for how an LLM thinks, not a REST API wrapper
  2. Descriptions are everything — the LLM reads descriptions to decide when to use a tool
  3. Pre-processed results — formatted for LLM consumption, not raw data dumps
  4. Keep the set compact — avoids context rot with clear, non-overlapping purposes
  5. Idempotent reads — search and list operations are safe to retry

Tool Workflow

Agent needs documentation info


  ┌──────────────┐
  │ list_libraries│ ← "What docs are indexed?"
  └──────┬───────┘

         ├── Library exists ──→ search_docs ──→ get_doc_page
         │                      (80% of usage)   (deep read)

         └── Not found ──────→ manage_library (action=add)

                               manage_library (action=rename)

                               manage_library (action=refresh)

                               manage_library (action=remove)

search_docs

The primary tool. Full-text search across all indexed documentation.

When agents use it: Whenever they need to find information about a library, API, framework feature, or code pattern.

ParameterTypeRequiredDescription
querystringYesNatural language or specific search terms
librarystringNoFilter results to a specific library
limitnumberNoMax results (1-20, default: 5)

Example output:

## Results for "svelte transitions"

### 1. Transitions — Svelte 5 Documentation
**Source:** https://svelte.dev/docs/svelte/transition
**Section:** Built-in transitions > fade

Svelte provides several built-in transition functions:
- `fade` — fades the element in and out
- `fly` — flies the element in from a specified position

list_libraries

Discovery tool. Shows what documentation is currently indexed.

ParameterTypeRequiredDescription
statusstringNoFilter: indexed, crawling, error, or all

Example output:

## Indexed Libraries (4 total)

| Library     | URL                         | Pages | Chunks | Status  |
| ----------- | --------------------------- | ----- | ------ | ------- |
| svelte-5    | https://svelte.dev/docs     | 47    | 312    | indexed |
| tailwind-v4 | https://tailwindcss.com/docs| 89    | 654    | indexed |

get_doc_page

Deep read. Retrieve full markdown content of a specific documentation page.

ParameterTypeRequiredDescription
urlstringNoFull URL of the documentation page
librarystringNoLibrary name to search within
pathstringNoRelative path within the library

manage_library

Manage an existing documentation library or add a new one.

ActionPurpose
addCrawl and index a new documentation website
renameChange the stored and display name of a library
refreshRe-crawl an existing library for updates
removeDelete a library and all indexed content
infoInspect stats and indexed pages for a library
ParameterTypeRequiredDescription
actionstringYesOne of add, rename, refresh, remove, info
urlstringNoBase URL of the docs site for add
namestringNoShort identifier for add
versionstringNoVersion string for add
max_depthnumberNoMax crawl depth for add
current_namestringNoExisting library name for rename
new_namestringNoReplacement library name for rename
librarystringNoLibrary name for refresh, remove, or info

Use action=add to create a new library, action=rename to retitle an existing one, action=refresh to re-crawl, action=remove to delete a library, and action=info to inspect its pages and stats.

A local-first research notebook for software documentation. Crawl, index, and serve real docs to coding agents without adding a cloud layer to the workflow.

GitHub repository

Built for grounded documentation workflows and long-form technical reading.

© 2026 DocShark