1086
const toolSearchActive = this._isToolSearchActive();
1087
const sessionTools = toolSearchActive
1089
: tools.filter(def => def.name !== CLIENT_TOOL_SEARCH_REFERENCE_NAME);
1090
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1091
return sessionTools.map((def): Tool<any> => {
1092
if (toolSearchActive && def.name === CLIENT_TOOL_SEARCH_REFERENCE_NAME) {
1094
>
name: RUNTIME_TOOL_SEARCH_TOOL_NAME,
1095
>
description: def.description ?? '',
1096
>
parameters: def.inputSchema ?? { type: 'object' as const, properties: {} },
1097
>
overridesBuiltInTool: true,
1098
>
defer: 'never',
1099
>
skipPermission: true,
1100
>
handler: async (_args: Record<string, unknown>, invocation) => {
1101
try {
1102
const candidates = this._toToolSearchCandidates(invocation.availableTools);