Tools / Library Docs
Library Docs icon

Library Docs

Up-to-date docs and code examples for any library

Fetch accurate, version-specific documentation and code examples for any library or framework. Start with resolve_library to find the library ID, then get_docs to pull relevant snippets. Covers thousands of libraries including React, Next.js, Prisma, Express, and Tailwind.

2 skillsv0.02
Resolve Library

Search for a library by name and return its Context7-compatible library ID along with metadata like trust score, available versions, and snippet count. Always call this first to get the ID needed by get_docs.

Returns: List of matching libraries with Context7 IDs, trust scores, available versions, and documentation coverage
Parameters
library_name *stringLibrary or framework name to search for (e.g. "react", "next.js", "prisma", "tailwindcss")
querystringOptional natural language context to help rank results (e.g. "React hooks for state management")
Example
Find the library ID for React
curl -H "Authorization: Bearer $TOOLROUTER_API_KEY" \
  -d '{
  "tool": "library-docs",
  "skill": "resolve_library",
  "input": {
    "library_name": "react"
  }
}' \
  https://api.toolrouter.com/v1/tools/call
Get Documentation

Fetch up-to-date documentation and code examples for a library using its Context7-compatible ID. Returns relevant snippets ranked by the query. Use after resolve_library to get the library ID.

Returns: Markdown documentation and code examples relevant to the query, ranked by relevance
Parameters
library_id *stringContext7-compatible library ID in format "/owner/repo", "/owner/repo/version", or "/owner/repo@version" — obtained from resolve_library
query *stringNatural language question or topic to fetch relevant documentation for (e.g. "how to use useEffect", "server actions")
tokensnumberMaximum tokens of documentation to retrieve (default: 5000, increase for more context)
topicstringOptional focused topic filter to narrow results (e.g. "hooks", "routing", "authentication")
Example
Get React hooks documentation
curl -H "Authorization: Bearer $TOOLROUTER_API_KEY" \
  -d '{
  "tool": "library-docs",
  "skill": "get_docs",
  "input": {
    "library_id": "/facebook/react",
    "query": "how to use useEffect",
    "topic": "hooks"
  }
}' \
  https://api.toolrouter.com/v1/tools/call
Loading reviews...
Loading activity...
v0.022026-03-29
  • Both skills marked paid at $0.005/request
v0.012026-03-29
  • Initial release with resolve_library and get_docs skills

Quick Start

MCP (Claude Code)
claude mcp add --transport stdio \
  --env TOOLROUTER_API_KEY=YOUR_API_KEY \
  toolrouter -- npx -y toolrouter-mcp
REST API
curl -H "Authorization: Bearer $TOOLROUTER_API_KEY" \
  -d '{"tool":"library-docs","skill":"resolve_library","input":{}}' \
  https://api.toolrouter.com/v1/tools/call