@@ -345,7 +345,8 @@ export class ActorsMcpServer {
345
345
* @throws {McpError } - based on the McpServer class code from the typescript MCP SDK
346
346
*/
347
347
this . server . setRequestHandler ( CallToolRequestSchema , async ( request ) => {
348
- const { name, arguments : args } = request . params ;
348
+ // eslint-disable-next-line prefer-const
349
+ let { name, arguments : args } = request . params ;
349
350
const apifyToken = ( request . params . apifyToken || process . env . APIFY_TOKEN ) as string ;
350
351
351
352
// Remove apifyToken from request.params just in case
@@ -362,6 +363,16 @@ export class ActorsMcpServer {
362
363
) ;
363
364
}
364
365
366
+ // Claude is saving tool names with 'local__' prefix, name is local__apify-actors__compass-slash-crawler-google-places
367
+ // We are interested in the Actor name only, so we remove the 'local__apify-actors__' prefix
368
+ if ( name . startsWith ( 'local__' ) ) {
369
+ // we split the name by '__' and take the last part, which is the actual Actor name
370
+ const parts = name . split ( '__' ) ;
371
+ log . info ( `Tool name with prefix detected: ${ name } , using last part: ${ parts [ parts . length - 1 ] } ` ) ;
372
+ if ( parts . length > 1 ) {
373
+ name = parts [ parts . length - 1 ] ;
374
+ }
375
+ }
365
376
// TODO - if connection is /mcp client will not receive notification on tool change
366
377
// Find tool by name or actor full name
367
378
const tool = Array . from ( this . tools . values ( ) )
0 commit comments