Skip to content

Commit e50ee0d

Browse files
committed
refactor: remove folders parameter support from library documentation fetching
1 parent ce2a63a commit e50ee0d

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,9 @@ server.tool(
135135
),
136136
},
137137
async ({ context7CompatibleLibraryID, tokens = DEFAULT_MINIMUM_TOKENS, topic = "" }) => {
138-
// Extract folders parameter if present in the ID
139-
let folders = "";
140-
let libraryId = context7CompatibleLibraryID;
141-
142-
if (context7CompatibleLibraryID.includes("?folders=")) {
143-
const [id, foldersParam] = context7CompatibleLibraryID.split("?folders=");
144-
libraryId = id;
145-
folders = foldersParam;
146-
}
147-
148-
const documentationText = await fetchLibraryDocumentation(libraryId, {
138+
const documentationText = await fetchLibraryDocumentation(context7CompatibleLibraryID, {
149139
tokens,
150140
topic,
151-
folders,
152141
});
153142

154143
if (!documentationText) {

src/lib/api.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export async function fetchLibraryDocumentation(
3535
options: {
3636
tokens?: number;
3737
topic?: string;
38-
folders?: string;
3938
} = {}
4039
): Promise<string | null> {
4140
try {
@@ -45,7 +44,6 @@ export async function fetchLibraryDocumentation(
4544
const url = new URL(`${CONTEXT7_API_BASE_URL}/v1/${libraryId}`);
4645
if (options.tokens) url.searchParams.set("tokens", options.tokens.toString());
4746
if (options.topic) url.searchParams.set("topic", options.topic);
48-
if (options.folders) url.searchParams.set("folders", options.folders);
4947
url.searchParams.set("type", DEFAULT_TYPE);
5048
const response = await fetch(url, {
5149
headers: {

0 commit comments

Comments
 (0)