@@ -25,7 +25,7 @@ import {
2525} from '../const.js' ;
2626import { addRemoveTools , callActorGetDataset , defaultTools , getActorsAsTools , toolCategories } from '../tools/index.js' ;
2727import { actorNameToToolName , decodeDotPropertyNames } from '../tools/utils.js' ;
28- import type { ActorMcpTool , ActorTool , HelperTool , ToolCategory , ToolEntry } from '../types.js' ;
28+ import type { ActorMcpTool , ActorTool , HelperTool , ToolEntry } from '../types.js' ;
2929import { connectMCPClient } from './client.js' ;
3030import { EXTERNAL_TOOL_CALL_TIMEOUT_MSEC } from './const.js' ;
3131import { processParamsGetTools } from './utils.js' ;
@@ -166,14 +166,11 @@ export class ActorsMcpServer {
166166 const loadedTools = this . listAllToolNames ( ) ;
167167 const actorsToLoad : string [ ] = [ ] ;
168168 const toolsToLoad : ToolEntry [ ] = [ ] ;
169- const internalToolMap = new Map ( [ ...defaultTools , ...addRemoveTools ] . map ( ( tool ) => [ tool . tool . name , tool ] ) ) ;
170- // Add all category tools
171- for ( const key of Object . keys ( toolCategories ) ) {
172- const tools = toolCategories [ key as ToolCategory ] ;
173- for ( const tool of tools ) {
174- internalToolMap . set ( tool . tool . name , tool ) ;
175- }
176- }
169+ const internalToolMap = new Map ( [
170+ ...defaultTools ,
171+ ...addRemoveTools ,
172+ ...Object . values ( toolCategories ) . flat ( ) ,
173+ ] . map ( ( tool ) => [ tool . tool . name , tool ] ) ) ;
177174
178175 for ( const tool of toolNames ) {
179176 // Skip if the tool is already loaded
0 commit comments