mirror of
https://github.com/upstash/context7.git
synced 2025-06-26 23:50:04 +00:00
version support in mcp
This commit is contained in:
parent
5fc52df93c
commit
d29a9457f3
1
.gitignore
vendored
1
.gitignore
vendored
@ -173,3 +173,4 @@ dist
|
|||||||
|
|
||||||
# Finder (MacOS) folder config
|
# Finder (MacOS) folder config
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
package-lock.json
|
||||||
|
@ -39,7 +39,7 @@ server.tool(
|
|||||||
"resolve-library-id",
|
"resolve-library-id",
|
||||||
`Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.
|
`Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.
|
||||||
|
|
||||||
You MUST call this function before 'get-library-docs' to obtain a valid Context7-compatible library ID.
|
You 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 'library:/org/project' or 'library:/org/project/version' in their query.
|
||||||
|
|
||||||
Selection Process:
|
Selection Process:
|
||||||
1. Analyze the query to understand what library/package the user is looking for
|
1. Analyze the query to understand what library/package the user is looking for
|
||||||
@ -100,6 +100,7 @@ Each result includes:
|
|||||||
- Description: Short summary
|
- Description: Short summary
|
||||||
- Code Snippets: Number of available code examples
|
- Code Snippets: Number of available code examples
|
||||||
- Trust Score: Authority indicator
|
- Trust Score: Authority indicator
|
||||||
|
- Versions: List of versions if available. Use one of those versions if and only if the user explicitly provides a version in their query.
|
||||||
|
|
||||||
For best results, select libraries based on name match, trust score, snippet coverage, and relevance to your use case.
|
For best results, select libraries based on name match, trust score, snippet coverage, and relevance to your use case.
|
||||||
|
|
||||||
@ -114,12 +115,12 @@ ${resultsText}`,
|
|||||||
|
|
||||||
server.tool(
|
server.tool(
|
||||||
"get-library-docs",
|
"get-library-docs",
|
||||||
"Fetches up-to-date documentation for a library. You 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 'library:/org/project'.",
|
"Fetches up-to-date documentation for a library. You 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 'library:/org/project' or 'library:/org/project/version' in their query.",
|
||||||
{
|
{
|
||||||
context7CompatibleLibraryID: z
|
context7CompatibleLibraryID: z
|
||||||
.string()
|
.string()
|
||||||
.describe(
|
.describe(
|
||||||
"Exact Context7-compatible library ID (e.g., 'mongodb/docs', 'vercel/nextjs') retrieved from 'resolve-library-id' or directly from user query in the format 'library:/org/project'."
|
"Exact Context7-compatible library ID (e.g., 'mongodb/docs', 'vercel/nextjs', 'supabase/supabase', 'vercel/nextjs/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format 'library:/org/project' or 'library:/org/project/version'."
|
||||||
),
|
),
|
||||||
topic: z
|
topic: z
|
||||||
.string()
|
.string()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user