fetch-library-docs

Fetches official library documentation via Context7 MCP with content-type filtering to reduce token usage.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/ramshan00/hackaton --skill fetch-library-docs-ramshan00
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fetch-library-docs
Source: https://github.com/ramshan00/hackaton/tree/main/Hackathon2-phase3/.claude/skills/fetch-library-docs
Command: npx skills add https://github.com/ramshan00/hackaton --skill fetch-library-docs-ramshan00

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @upstash/context7-mcp, and includes scripts (resource) and references (resource) components.

What problem does it solve? When writing code against libraries like React, Next.js, Prisma, or FastAPI, guessing API patterns from memory leads to errors, while pasting full documentation pages wastes enormous amounts of context tokens. This Skill fetches only the relevant slices of official documentation so coding decisions are grounded in current, correct references. ## Core Features & Use Cases - Token-Efficient Fetching: Retrieves docs through the Context7 MCP server and filters output by content type (examples, api-ref, setup, concepts, migration, troubleshooting, patterns), achieving 60-90% token savings via shell-based extraction that costs zero LLM tokens. - Auto-Detection Workflow: Maps task context (implementing, debugging, installing, integrating, upgrading) to the right content type, with library resolution from names, error messages, or direct Context7 IDs. - Robust Error Handling: Structured error codes for library-not-found, mismatches, empty results, and rate limits, plus exponential-backoff retries for infrastructure failures and multi-source API key configuration. - Use Case: While debugging a PrismaClientKnownRequestError, fetch troubleshooting and example content for unique constraint errors from the official Prisma docs instead of guessing at the fix. ## Quick Start Ask the assistant to fetch the official React documentation examples for useState before writing a new hook-based component.

Frequently Asked Questions about fetch-library-docs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fetch library documentation without wasting context tokens?

Run the fetch-docs.sh script with a library ID, topic, and content type such as examples or api-ref. The raw documentation stays in the shell subprocess and only filtered sections enter the context, yielding 60-90% token savings.

What libraries are supported by Context7 documentation fetching?

Any library indexed by Context7 works, including React, Next.js, Prisma, FastAPI, Express, Tailwind, MongoDB, Vue, Django, and Supabase. Use --library with a name to auto-resolve, or --library-id with a known ID like /vercel/next.js.

Do I need a Context7 API key to fetch documentation?

An API key is recommended for reliable access and higher rate limits. Save it via the CONTEXT7_API_KEY environment variable, a project-level .context7.env file, or ~/.context7.env, and get a free key at context7.com/dashboard.

Why does documentation fetching return LIBRARY_NOT_FOUND or EMPTY_RESULTS?

LIBRARY_NOT_FOUND means the name did not resolve, so try spelling variations or a direct --library-id. EMPTY_RESULTS means the query matched nothing, so broaden the topic or use --content-type all; the skill auto-falls back to all once.

What are the limitations of the Context7 documentation skill?

Context7 allows a maximum of 3 API calls per question, and this skill uses at most 2 for resolution and querying. It cannot fetch docs for private or local code, and rate limit or authentication errors are not retried.