MCP Tools Specification
DocShark exposes 4 MCP tools following the Six-Tool Pattern and MCP best practices.
Design intent
Design Principles
- Tools are a UI for agents — designed for how an LLM thinks, not a REST API wrapper
- Descriptions are everything — the LLM reads descriptions to decide when to use a tool
- Pre-processed results — formatted for LLM consumption, not raw data dumps
- Keep the set compact — avoids context rot with clear, non-overlapping purposes
- 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language or specific search terms |
library | string | No | Filter results to a specific library |
limit | number | No | Max 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter: 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | No | Full URL of the documentation page |
library | string | No | Library name to search within |
path | string | No | Relative path within the library |
manage_library
Manage an existing documentation library or add a new one.
| Action | Purpose |
|---|---|
add | Crawl and index a new documentation website |
rename | Change the stored and display name of a library |
refresh | Re-crawl an existing library for updates |
remove | Delete a library and all indexed content |
info | Inspect stats and indexed pages for a library |
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | One of add, rename, refresh, remove, info |
url | string | No | Base URL of the docs site for add |
name | string | No | Short identifier for add |
version | string | No | Version string for add |
max_depth | number | No | Max crawl depth for add |
current_name | string | No | Existing library name for rename |
new_name | string | No | Replacement library name for rename |
library | string | No | Library 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.