Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Fetch up-to-date documentation from Context7 for a library. Use when you need current API syntax, code examples, or official documentation for any library or framework.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 243% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -53% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -47% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-12 | ✗→✓ | ▲ Improved | -45% | 0% |
Fetch real-time, version-specific documentation and code examples for libraries.
Use this skill when:
CONTEXT7_API_KEY in the environment or a shell startup file such as ~/.bashrc (the bundled scripts can read either)owner/repo format (use context7-search first if unknown)bashpython3 ./scripts/fetch_docs.py --library "owner/repo"
bashpython3 ./scripts/fetch_docs.py --library "owner/repo" --topic "TOPIC"
bashpython3 ./scripts/fetch_docs.py --library "owner/repo" --type info
bashpython3 ./scripts/fetch_docs.py --library "owner/repo" --version "v15.1.8"
| Parameter | Required | Default | Description | |-----------|----------|---------|-------------| | --library | Yes | - | Library in owner/repo format | | --topic | No | - | Focus on specific feature/topic | | --type | No | code | code for snippets, info for docs | | --version | No | latest | Specific version tag | | --page | No | 1 | Page number for pagination |
bashpython3 ./scripts/fetch_docs.py \ --library "vercel/next.js" \ --topic "routing"
bashpython3 ./scripts/fetch_docs.py \ --library "prisma/prisma" \ --topic "postgresql connection"
bashpython3 ./scripts/fetch_docs.py \ --library "facebook/react" \ --topic "hooks" \ --type info
bashpython3 ./scripts/fetch_docs.py \ --library "vercel/next.js" \ --version "v14.3.0" \ --topic "app router"
json{ "success": true, "data": { "library": "vercel/next.js", "topic": "routing", "type": "code", "content": { "content": "### Dynamic Route Handler\n\nSource: ...\n\n```typescript\nexport async function GET(...) {...}\n```\n\n---\n\n### Another Example\n..." } } }
| Library | ID | Common Topics | |---------|-------------|---------------| | Next.js | vercel/next.js | routing, server components, api routes | | React | facebook/react | hooks, state, context, suspense | | Prisma | prisma/prisma | setup, queries, relations, migrations | | Supabase | supabase/supabase | auth, realtime, row level security | | FastAPI | fastapi/fastapi | routing, validation, dependencies | | Express | expressjs/express | middleware, routing, error handling | | Tailwind | tailwindlabs/tailwindcss | configuration, utilities, plugins |
User: "How do I set up authentication with Supabase?"
1. Search for library (if ID unknown):
python3 ./scripts/resolve_library.py --query "supabase"
→ Returns supabase/supabase
2. Fetch focused documentation:
python3 ./scripts/fetch_docs.py \
--library "supabase/supabase" \
--topic "authentication"User: "Show me the latest Next.js routing API"
Fetch directly (skip search):
python3 ./scripts/fetch_docs.py \
--library "vercel/next.js" \
--topic "app router"Library not found (404):
context7-search to find the correct library IDowner/repo (e.g., vercel/next.js)Topic not matched:
Authentication error:
--topic--type code gives practical examples--type info for documentation/explanations--version for version-specific syntaxOther measured skills in the registry, with their headline benchmark lift.