fetching-library-docs

Fetches library documentation via Context7 MCP with shell-based token filtering.

9|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill fetching-library-docs-abdullahmalik17
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fetching-library-docs
Source: https://github.com/AbdullahMalik17/Hacathan_5/tree/main/.claude/skills/fetching-library-docs
Command: npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill fetching-library-docs-abdullahmalik17

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Fetching full library documentation through MCP tools floods the LLM context with hundreds of unnecessary tokens, inflating cost and reducing available context for actual work. ## Core Features & Use Cases - Token-Efficient Fetching: A shell pipeline keeps the full Context7 response in a subprocess and returns only filtered code examples, API signatures, and key notes, achieving roughly 77% token savings. - Library Resolution and Modes: Resolves library names to Context7 IDs automatically, supports code mode for examples and info mode for conceptual explanations, plus pagination for deeper exploration. - Use Case: When a user asks "Show me React useState examples", the skill resolves React, fetches the docs, and returns about 205 tokens of filtered examples instead of the raw 934-token response. ## Quick Start Ask the assistant to show code examples or API usage for a specific library and topic, such as React hooks or Prisma queries.

Frequently Asked Questions about fetching-library-docs

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

FAQPage Schema
How do I fetch library documentation with Context7 MCP?▼

Run the fetch-docs.sh script with a library name and topic, for example --library react --topic useState. The script resolves the library ID, fetches the docs, and returns filtered code examples and API signatures.

How does this approach reduce token usage when fetching docs?▼

The full Context7 response stays inside a shell subprocess while awk, grep, and sed extract only code blocks, signatures, and notes. Only the filtered output enters the LLM context, cutting usage from about 934 tokens to about 205 tokens per query.

Which libraries are supported by Context7 documentation lookup?▼

Any published library indexed by Context7 works, including React, Next.js, Express, Prisma, MongoDB, Vue, Svelte, Fastify, and NestJS. You can pass a name for automatic resolution or a direct ID like /vercel/next.js.

What is the difference between code mode and info mode?▼

Code mode returns code examples and API signatures and is the default. Info mode returns conceptual explanations and overview paragraphs with fewer examples, which suits learning-oriented questions.

Why does library resolution fail for some names?▼

Resolution can fail when the name does not match Context7's index. Try variations such as next.js, nextjs, or next, or pass the exact Context7 library ID directly with --library-id to skip resolution.

When should I not use this documentation fetcher?▼

Do not use it for exploring a repository's internal source code or local files, since it only fetches published library documentation. For repo internals, use a source exploration tool such as a deepwiki-based research skill instead.