@@ -126,7 +126,7 @@ async function getMCPServersAsTools(
126126) : Promise < ToolWrap [ ] > {
127127 const actorsMCPServerTools : ToolWrap [ ] = [ ] ;
128128 for ( const actorID of actors ) {
129- const serverUrl = await getActorsMCPServerURL ( actorID ) ;
129+ const serverUrl = await getActorsMCPServerURL ( actorID , apifyToken ) ;
130130
131131 let client : Client | undefined ;
132132 try {
@@ -148,22 +148,22 @@ export async function getActorsAsTools(
148148 console . log ( 'Fetching actors as tools...' ) ;
149149 console . log ( actors )
150150 // Actorized MCP servers
151- const actorsMCPServer : string [ ] = [ ] ;
151+ const actorsMCPServers : string [ ] = [ ] ;
152152 for ( const actorID of actors ) {
153- if ( await isActorMCPServer ( actorID ) ) {
154- actorsMCPServer . push ( actorID ) ;
153+ if ( await isActorMCPServer ( actorID , apifyToken ) ) {
154+ actorsMCPServers . push ( actorID ) ;
155155 }
156156 }
157157 // Normal Actors as a tool
158- const toolActors = actors . filter ( ( actorID ) => ! actorsMCPServer . includes ( actorID ) ) ;
159- console . log ( 'actorsMCPserver' , actorsMCPServer ) ;
158+ const toolActors = actors . filter ( ( actorID ) => ! actorsMCPServers . includes ( actorID ) ) ;
159+ console . log ( 'actorsMCPserver' , actorsMCPServers ) ;
160160 console . log ( 'toolActors' , toolActors ) ;
161161
162162 // Normal Actors as a tool
163163 const normalTools = await getNormalActorsAsTools ( toolActors , apifyToken ) ;
164164
165165 // Tools from Actorized MCP servers
166- const mcpServerTools = await getMCPServersAsTools ( actorsMCPServer , apifyToken ) ;
166+ const mcpServerTools = await getMCPServersAsTools ( actorsMCPServers , apifyToken ) ;
167167
168168 return [ ...normalTools , ...mcpServerTools ] ;
169169}
0 commit comments