MCP Tools
DocuLayer exposes four tools to any MCP-compatible client (Claude Code, Cursor, VS Code, Windsurf, Zed, and any other MCP host).
Every response includes a citation block with a source URL and freshness timestamp. No generated text ever appears.
doculayer_search
BM25 search across live doc sections. Returns verbatim content ranked by relevance.
doculayer_search(query, source, max_results=5)
| Parameter | Type | Default | Description |
|---|---|---|---|
query | str | — | What to look for — e.g. "streaming responses", "dependency injection" |
source | str | — | Package or URL — "fastapi", "pypi:httpx", "npm:react", "gh:owner/repo", "https://docs.example.com" |
max_results | int | 5 | Number of sections to return (1–10) |
Example
Agent prompt:
"Search doculayer for 'dependency injection' in fastapi"
Tool call:
{ "query": "dependency injection", "source": "fastapi", "max_results": 3 }
Response (verbatim, abridged):
> **Source**: https://fastapi.tiangolo.com/tutorial/dependencies/
> **Fetched**: 2s ago
## Dependencies
FastAPI has a powerful but intuitive **Dependency Injection** system...
doculayer_fetch
Fetch a full documentation page or a named heading section.
doculayer_fetch(source, section=None)
| Parameter | Type | Default | Description |
|---|---|---|---|
source | str | — | Package or URL — same formats as doculayer_search |
section | str | None | None | Heading to extract — e.g. "AsyncClient", "Authentication" |
Use section= to avoid fetching an entire large page when you only need one part.
Example
{ "source": "httpx", "section": "AsyncClient" }
doculayer_symbol
Look up documentation for a specific API symbol (function, class, or method).
doculayer_symbol(symbol, source=None)
| Parameter | Type | Default | Description |
|---|---|---|---|
symbol | str | — | Function, class, or method — e.g. "AsyncClient.get", "FastAPI.include_router", "useEffect" |
source | str | None | None | Package to scope the lookup; auto-inferred from dotted prefix (e.g. "httpx.AsyncClient.get" → source "httpx" inferred) |
Returns the symbol's documentation verbatim: signature, description, parameters, and examples as they appear in the live docs.
Example
{ "symbol": "httpx.AsyncClient.get" }
The source is auto-inferred as "httpx" from the dotted prefix.
doculayer_sources
List known documentation sources, identifier formats, and live cache stats.
doculayer_sources()
No parameters. Returns:
- All packages with built-in llms.txt shortcuts
- Accepted identifier formats
- Current cache state (entries, TTL remaining)
Example output (abridged)
Known packages with llms.txt support (fastest access):
anthropic · astro · fastapi · httpx · langchain · nextjs · openai
pydantic · react · shadcn · supabase · svelte · tailwindcss · vite · vue
Identifier formats: bare-name · pypi: · npm: · gh: · https://
Cache: 3 entries, TTL 3600s
Citation Format
Every tool response carries a citation block at the top of each section:
> **Source**: https://docs.pydantic.dev/latest/concepts/validators/
> **Fetched**: 4s ago
This guarantees traceability — the agent always knows which URL and how fresh the content is.