Refactor
This commit is contained in:
@@ -40,8 +40,11 @@ export function cloakClaudeTools(body) {
|
||||
const clientToolNames = new Set();
|
||||
const clientDeclarations = [];
|
||||
|
||||
// All client tools get renamed with suffix
|
||||
// All client tools get renamed with suffix.
|
||||
// Built-in server tools (web_search_20250305, etc.) carry a `type` and require
|
||||
// an exact reserved `name` — never suffix those or Claude rejects the request.
|
||||
for (const tool of tools) {
|
||||
if (tool.type) { clientDeclarations.push(tool); continue; }
|
||||
const suffixed = suffix(tool.name);
|
||||
toolNameMap.set(suffixed, tool.name);
|
||||
clientToolNames.add(tool.name);
|
||||
|
||||
Reference in New Issue
Block a user