Agent skill
context7
Fetch up-to-date library documentation using Context7. Use when the user asks to "fetch documentation from context7", "get library docs", "resolve a library ID", "use context7 MCP tools", or mentions context7 library documentation. Provides dynamic MCP tool invocation without loading all tool definitions into context.
Install this agent skill to your Project
npx add-skill https://github.com/akaihola/skills-akaihola/tree/main/context7-skill
SKILL.md
context7 Skill
This skill provides dynamic access to the context7 MCP server without loading all tool definitions into context.
Context Efficiency
Traditional MCP approach:
- All 2 tools loaded at startup
- Estimated context: 1000 tokens
This skill approach:
- Metadata only: ~100 tokens
- Full instructions (when used): ~5k tokens
- Tool execution: 0 tokens (runs externally)
How This Works
Instead of loading all MCP tool definitions upfront, this skill:
- Lists available tool names and brief descriptions
- Decide which tool to call based on the user's request
- Generate a JSON command to invoke the tool
- The executor handles the actual MCP communication
Available Tools
resolve-library-id: Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.
MUST call this function before 'get-library-docs' to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.
Selection Process:
- Analyze the query to understand what library/package the user is looking for
- Return the most relevant match based on:
- Name similarity to the query (exact matches prioritized)
- Description relevance to the query's intent
- Documentation coverage (prioritize libraries with higher Code Snippet counts)
- Source reputation (consider libraries with High or Medium reputation more authoritative)
- Benchmark Score: Quality indicator (100 is the highest score)
Response Format:
- Return the selected library ID in a clearly marked section
- Provide a brief explanation for why this library was chosen
- If multiple good matches exist, acknowledge this but proceed with the most relevant one
- If no good matches exist, clearly state this and suggest query refinements
For ambiguous queries, request clarification before proceeding with a best-guess match.
get-library-docs: Fetches up-to-date documentation for a library. MUST call 'resolve-library-id' first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.
Usage Pattern
When the user's request matches this skill's capabilities:
Step 1: Identify the right tool from the list above
Step 2: ALWAYS get tool details first to obtain correct parameter names and types:
cd $SKILL_DIR
./executor.py --describe tool_name
This loads ONLY that tool's schema, not all tools.
Step 3: Generate a tool call using the exact parameter names from Step 2:
{
"tool": "tool_name",
"arguments": {
"param1": "value1",
"param2": "value2"
}
}
Step 4: Execute via bash:
cd $SKILL_DIR
./executor.py --call 'YOUR_JSON_HERE'
IMPORTANT: Replace $SKILL_DIR with the actual discovered path of this skill directory.
Important Note
MUST use --describe before calling any tool to get the correct parameter names and types. Do not guess parameter names as this will result in errors.
Examples
Example 1: Complete workflow
User: "Use context7 to do X"
Your workflow:
- Identify tool:
resolve-library-id - Get tool details:
./executor.py --describe resolve-library-id - Generate call JSON using exact parameter names from Step 2
- Execute:
cd $SKILL_DIR
./executor.py --call '{"tool": "resolve-library-id", "arguments": {"param1": "value"}}'
Example 2: Tool details output
cd $SKILL_DIR
./executor.py --describe resolve-library-id
Returns the full schema with parameter names, types, and requirements.
Error Handling
If the executor returns an error:
- Check the tool name is correct
- Verify
--describewas used to get the exact parameter names - Ensure all required arguments are provided
- Check that parameter types match what's expected
- Ensure the MCP server is accessible
Common error: "Invalid arguments for tool" - This usually means an incorrect parameter name was used. Always run --describe first to get the correct parameter names.
Performance Notes
Context usage comparison for this skill:
| Scenario | MCP (preload) | Skill (dynamic) |
|---|---|---|
| Idle | 1000 tokens | 100 tokens |
| Active | 1000 tokens | 5k tokens |
| Executing | 1000 tokens | 0 tokens |
Savings: ~-400% reduction in typical usage
Additional Resources
Examples
examples/test_skill.py- Test script for skill validation
This skill was auto-generated from an MCP server configuration. Generator: mcp_to_skill.py
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
youtube-to-markdown
Convert a YouTube video into clean, readable Markdown using its free auto-generated captions (no paid API needed). Use when the user asks to "convert YouTube video to markdown", "get transcript from YouTube URL", "summarise this video", or wants to turn YouTube subtitles/captions into readable text. Prefer this over youtube-transcription when the video already has auto-generated subtitles — it's free and faster. Accepts YouTube URLs.
brave-search
Search the web using Brave Search API. Use when the user asks to "search the web", "look up current information", "find news about", "research a topic online", "check prices online", or needs up-to-date facts that may not be in the model's training data. Requires BRAVE_SEARCH_API_KEY. Supports structured web results (pages, FAQs, news, videos) and an optional AI summarizer.
verkkokauppa
Search products on the Verkkokauppa.com Finnish webshop. This skill uses the Verkkokauppa search API directly, requiring no browser. Use when the user asks to "search Verkkokauppa", "find products on verkkokauppa.com", "verkkokauppa product search", "check Verkkokauppa prices", or mentions searching the Verkkokauppa store.
clasohlson
Search products on the Clas Ohlson Finland webshop (clasohlson.com/fi/). This skill uses the Voyado Elevate (Apptus eSales) search API directly, requiring no browser. Use when the user asks to "search Clas Ohlson", "find products on clasohlson.com", "clas ohlson product search", "check Clas Ohlson prices", or mentions searching the Finnish Clas Ohlson store.
bauhaus
Search products on the Bauhaus webshop (bauhaus.fi). This skill uses the Algolia search API with automatic key refresh. Use when the user asks to "search Bauhaus", "find products on bauhaus.fi", "bauhaus product search", "check Bauhaus prices", or mentions searching the Bauhaus store.
library
Didn't find tool you were looking for?