Install
openclaw skills install context7-docsFetches up-to-date, version-specific documentation and code examples for any programming library or framework from Context7. Use this skill when the user needs current API docs, code examples, setup guides, or configuration help for any library, package, or framework — especially when you are unsure if your training data is current. Activate when the user mentions needing docs, examples, or asks about library APIs, versions, or configuration.
openclaw skills install context7-docsContext7 provides up-to-date, version-specific documentation and code examples for thousands of programming libraries and frameworks. Use this skill whenever you need current documentation that may differ from your training data — especially for fast-moving libraries like Next.js, React, Supabase, LangChain, etc.
First, find the Context7-compatible library ID for the library the user is asking about.
bash scripts/resolve-library.sh --query "How to set up authentication" --library-name "next.js"
This returns a list of matching libraries with:
/vercel/next.js (use this in Step 2)/vercel/next.js/v14.3.0Selection criteria — Pick the library that best matches based on:
If the user already provides a library ID in /org/project format, skip this step.
Use the library ID from Step 1 to fetch relevant documentation:
bash scripts/query-docs.sh --library-id "/vercel/next.js" --query "How to set up authentication with JWT"
This returns documentation text with code examples directly relevant to the query.
You can also call the API directly without the scripts:
Search for a library:
curl -s "https://context7.com/api/search" \
-H "Content-Type: application/json" \
${CONTEXT7_API_KEY:+-H "Authorization: Bearer $CONTEXT7_API_KEY"} \
-d '{"query": "How to set up auth", "libraryName": "next.js"}' | jq .
Query documentation:
curl -s "https://context7.com/api/context" \
-H "Content-Type: application/json" \
${CONTEXT7_API_KEY:+-H "Authorization: Bearer $CONTEXT7_API_KEY"} \
-d '{"query": "JWT authentication middleware", "libraryId": "/vercel/next.js"}' | jq .
/vercel/next.js/v14.3.0).| Situation | Action |
|---|---|
| No results from resolve | Try a different library name or broader search term |
| Multiple good matches | Pick the one with the best name match + highest snippet count |
| User specifies a version | Look for versioned IDs in resolve results |
| Empty docs response | Try a more specific or different query |
| Rate limit hit | Wait a moment and retry, or suggest the user set CONTEXT7_API_KEY |
For higher rate limits, set a free API key:
export CONTEXT7_API_KEY="your-key-here"
Get a free key at: https://context7.com/dashboard