@@ -470,18 +470,29 @@ export abstract class ToolBase {
470470 }
471471 } ;
472472
473- this . registeredTool = (
474- server . mcpServer . tool as (
475- // Note: We use explicit type casting here to avoid "excessively deep and possibly infinite" errors
476- // that occur when TypeScript tries to infer the complex generic types from `typeof this.argsShape`
477- // in the abstract class context.
478- name : string ,
479- description : string ,
480- argsShape : ZodRawShape ,
481- annotations : ToolAnnotations ,
482- cb : ( args : ToolArgs < ZodRawShape > , { signal } : ToolExecutionContext ) => Promise < CallToolResult >
483- ) => RegisteredTool
484- ) ( this . name , this . description , this . argsShape , this . annotations , callback ) ;
473+ this . registeredTool =
474+ // Note: We use explicit type casting here to avoid "excessively deep and possibly infinite" errors
475+ // that occur when TypeScript tries to infer the complex generic types from `typeof this.argsShape`
476+ // in the abstract class context.
477+ (
478+ server . mcpServer . registerTool as (
479+ name : string ,
480+ config : {
481+ description ?: string ;
482+ inputSchema ?: ZodRawShape ;
483+ annotations ?: ToolAnnotations ;
484+ } ,
485+ cb : ( args : ToolArgs < ZodRawShape > , extra : ToolExecutionContext ) => Promise < CallToolResult >
486+ ) => RegisteredTool
487+ ) (
488+ this . name ,
489+ {
490+ description : this . description ,
491+ inputSchema : this . argsShape ,
492+ annotations : this . annotations ,
493+ } ,
494+ callback
495+ ) ;
485496
486497 return true ;
487498 }
0 commit comments