Skip to content

Context7 Platform -- Up-to-date docs for AI agents

refactor: remove folders parameter support from library documentation fetching

Abdusshhe50ee0dfd3a1
diff --git a/src/index.ts b/src/index.ts
index e5a96f23..9d80c965 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -135,20 +135,9 @@ server.tool(
),
},
async ({ context7CompatibleLibraryID, tokens = DEFAULT_MINIMUM_TOKENS, topic = "" }) => {
- // Extract folders parameter if present in the ID
- let folders = "";
- let libraryId = context7CompatibleLibraryID;
-
- if (context7CompatibleLibraryID.includes("?folders=")) {
- const [id, foldersParam] = context7CompatibleLibraryID.split("?folders=");
- libraryId = id;
- folders = foldersParam;
- }
-
- const documentationText = await fetchLibraryDocumentation(libraryId, {
+ const documentationText = await fetchLibraryDocumentation(context7CompatibleLibraryID, {
tokens,
topic,
- folders,
});
if (!documentationText) {
diff --git a/src/lib/api.ts b/src/lib/api.ts
index 50e74b6d..58e95d9a 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -35,7 +35,6 @@ export async function fetchLibraryDocumentation(
options: {
tokens?: number;
topic?: string;
- folders?: string;
} = {}
): Promise<string | null> {
try {
@@ -45,7 +44,6 @@ export async function fetchLibraryDocumentation(
const url = new URL(`${CONTEXT7_API_BASE_URL}/v1/${libraryId}`);
if (options.tokens) url.searchParams.set("tokens", options.tokens.toString());
if (options.topic) url.searchParams.set("topic", options.topic);
- if (options.folders) url.searchParams.set("folders", options.folders);
url.searchParams.set("type", DEFAULT_TYPE);
const response = await fetch(url, {
headers: {