You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/index.ts
+6-16Lines changed: 6 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ server.tool(
39
39
"resolve-library-id",
40
40
`Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.
41
41
42
-
You MUST call this function before 'get-library-docs' to obtain a valid Context7-compatible library ID.
42
+
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 '/org/project' or '/org/project/version' in their query.
43
43
44
44
Selection Process:
45
45
1. Analyze the query to understand what library/package the user is looking for
@@ -95,11 +95,12 @@ For ambiguous queries, request clarification before proceeding with a best-guess
- Code Snippets: Number of available code examples
102
102
- Trust Score: Authority indicator
103
+
- Versions: List of versions if available. Use one of those versions if and only if the user explicitly provides a version in their query.
103
104
104
105
For best results, select libraries based on name match, trust score, snippet coverage, and relevance to your use case.
105
106
@@ -114,12 +115,12 @@ ${resultsText}`,
114
115
115
116
server.tool(
116
117
"get-library-docs",
117
-
"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.",
118
+
"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 '/org/project' or '/org/project/version' in their query.",
118
119
{
119
120
context7CompatibleLibraryID: z
120
121
.string()
121
122
.describe(
122
-
"Exact Context7-compatible library ID (e.g., 'mongodb/docs', 'vercel/nextjs') retrieved from 'resolve-library-id'."
123
+
"Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'."
0 commit comments