11import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js" ;
2- import type { ToolArgs , ToolCategory } from "../tool.js" ;
2+ import type { ToolArgs , ToolCategory , ToolExecutionContext } from "../tool.js" ;
33import { ToolBase } from "../tool.js" ;
4- import type { ToolCallback } from "@modelcontextprotocol/sdk/server/mcp.js" ;
54import type { Client } from "@mongodb-js/atlas-local" ;
65import { LogId } from "../../common/logger.js" ;
76import type { ConnectionMetadata } from "../../telemetry/types.js" ;
@@ -15,7 +14,11 @@ export abstract class AtlasLocalToolBase extends ToolBase {
1514 return this . session . atlasLocalClient !== undefined && super . verifyAllowed ( ) ;
1615 }
1716
18- protected async execute ( ...args : Parameters < ToolCallback < typeof this . argsShape > > ) : Promise < CallToolResult > {
17+ protected async execute (
18+ args : ToolArgs < typeof this . argsShape > ,
19+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
20+ _context : ToolExecutionContext
21+ ) : Promise < CallToolResult > {
1922 const client = this . session . atlasLocalClient ;
2023
2124 // If the client is not found, throw an error
@@ -38,7 +41,7 @@ please log a ticket here: https://github.com/mongodb-js/mongodb-mcp-server/issue
3841 } ;
3942 }
4043
41- return this . executeWithAtlasLocalClient ( client , ... args ) ;
44+ return this . executeWithAtlasLocalClient ( args , { client } ) ;
4245 }
4346
4447 private async lookupDeploymentId ( client : Client , containerId : string ) : Promise < string | undefined > {
@@ -72,8 +75,8 @@ please log a ticket here: https://github.com/mongodb-js/mongodb-mcp-server/issue
7275 }
7376
7477 protected abstract executeWithAtlasLocalClient (
75- client : Client ,
76- ... args : Parameters < ToolCallback < typeof this . argsShape > >
78+ args : ToolArgs < typeof this . argsShape > ,
79+ context : { client : Client }
7780 ) : Promise < CallToolResult > ;
7881
7982 protected handleError (
@@ -119,7 +122,10 @@ please log a ticket here: https://github.com/mongodb-js/mongodb-mcp-server/issue
119122 return super . handleError ( error , args ) ;
120123 }
121124
122- protected resolveTelemetryMetadata ( result : CallToolResult ) : ConnectionMetadata {
125+ protected resolveTelemetryMetadata (
126+ _args : ToolArgs < typeof this . argsShape > ,
127+ { result } : { result : CallToolResult }
128+ ) : ConnectionMetadata {
123129 const toolMetadata : ConnectionMetadata = { } ;
124130
125131 // Atlas Local tools set the deployment ID in the result metadata for telemetry
0 commit comments