mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Add excludeTools and includeTools to mcpServers config (#2976)
This commit is contained in:
committed by
GitHub
parent
aa8e5776eb
commit
355fb4ac67
@@ -305,6 +305,26 @@ async function connectAndDiscover(
|
||||
continue;
|
||||
}
|
||||
|
||||
const { includeTools, excludeTools } = mcpServerConfig;
|
||||
const toolName = funcDecl.name;
|
||||
|
||||
let isEnabled = false;
|
||||
if (includeTools === undefined) {
|
||||
isEnabled = true;
|
||||
} else {
|
||||
isEnabled = includeTools.some(
|
||||
(tool) => tool === toolName || tool.startsWith(`${toolName}(`),
|
||||
);
|
||||
}
|
||||
|
||||
if (excludeTools?.includes(toolName)) {
|
||||
isEnabled = false;
|
||||
}
|
||||
|
||||
if (!isEnabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let toolNameForModel = funcDecl.name;
|
||||
|
||||
// Replace invalid characters (based on 400 error message from Gemini API) with underscores
|
||||
|
||||
Reference in New Issue
Block a user