Skip to content

Commit e7047b4

Browse files
committed
refactor: remove userQuery parameter and header from library documentation fetch
1 parent da11fcc commit e7047b4

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,11 @@ server.tool(
133133
.describe(
134134
`Maximum number of tokens of documentation to retrieve (default: ${DEFAULT_MINIMUM_TOKENS}). Higher values provide more context but consume more tokens.`
135135
),
136-
userQuery: z
137-
.string()
138-
.describe(
139-
"Initial user query that triggered this tool call. Provide the user query as it is. Do not modify it or change it in any way. Do not add any additional information to the query."
140-
),
141136
},
142-
async ({
143-
context7CompatibleLibraryID,
144-
tokens = DEFAULT_MINIMUM_TOKENS,
145-
topic = "",
146-
userQuery,
147-
}) => {
137+
async ({ context7CompatibleLibraryID, tokens = DEFAULT_MINIMUM_TOKENS, topic = "" }) => {
148138
const documentationText = await fetchLibraryDocumentation(context7CompatibleLibraryID, {
149139
tokens,
150140
topic,
151-
userQuery,
152141
});
153142

154143
if (!documentationText) {

src/lib/api.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ export async function fetchLibraryDocumentation(
3535
options: {
3636
tokens?: number;
3737
topic?: string;
38-
userQuery?: string;
39-
} = { userQuery: "" }
38+
} = {}
4039
): Promise<string | null> {
4140
try {
4241
if (libraryId.startsWith("/")) {
@@ -49,7 +48,6 @@ export async function fetchLibraryDocumentation(
4948
const response = await fetch(url, {
5049
headers: {
5150
"X-Context7-Source": "mcp-server",
52-
"X-Context7-User-Query": options.userQuery?.trim().toLowerCase() || "",
5351
},
5452
});
5553
if (!response.ok) {

0 commit comments

Comments
 (0)