Skip to content

Commit f881902

Browse files
committed
chore: use .tool instead of .registerTool
doesn't seem like registerTool even exists...
1 parent 23c1099 commit f881902

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

src/tools/tool.ts

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -470,29 +470,18 @@ export abstract class ToolBase {
470470
}
471471
};
472472

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-
);
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);
496485

497486
return true;
498487
}

0 commit comments

Comments
 (0)