Skip to content

Commit 680d072

Browse files
chore: replace internalToolImplementations with AllTools
1 parent 9cc5526 commit 680d072

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

src/server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export class Server {
6060
private readonly telemetry: Telemetry;
6161
public readonly userConfig: UserConfig;
6262
public readonly elicitation: Elicitation;
63-
private readonly internalToolImplementations: ToolClass[] = AllTools;
6463
private readonly additionalToolImplementations: ToolClass[];
6564
public readonly tools: ToolBase[] = [];
6665
public readonly connectionErrorHandler: ConnectionErrorHandler;
@@ -242,7 +241,7 @@ export class Server {
242241

243242
private registerTools(): void {
244243
const toolImplementations = [
245-
...this.internalToolImplementations.map((toolConstructor) => ({
244+
...AllTools.map((toolConstructor) => ({
246245
toolConstructor,
247246
source: "internal",
248247
})),

src/tools/atlas/tools.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import { ListOrganizationsTool } from "./read/listOrgs.js";
1111
import { ConnectClusterTool } from "./connect/connectCluster.js";
1212
import { ListAlertsTool } from "./read/listAlerts.js";
1313
import { GetPerformanceAdvisorTool } from "./read/getPerformanceAdvisor.js";
14+
import type { ToolClass } from "../tool.js";
1415

15-
export const AtlasTools = [
16+
export const AtlasTools: ToolClass[] = [
1617
ListClustersTool,
1718
ListProjectsTool,
1819
InspectClusterTool,

src/tools/atlasLocal/tools.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@ import { DeleteDeploymentTool } from "./delete/deleteDeployment.js";
22
import { ListDeploymentsTool } from "./read/listDeployments.js";
33
import { CreateDeploymentTool } from "./create/createDeployment.js";
44
import { ConnectDeploymentTool } from "./connect/connectDeployment.js";
5+
import type { ToolClass } from "../tool.js";
56

6-
export const AtlasLocalTools = [ListDeploymentsTool, DeleteDeploymentTool, CreateDeploymentTool, ConnectDeploymentTool];
7+
export const AtlasLocalTools: ToolClass[] = [
8+
ListDeploymentsTool,
9+
DeleteDeploymentTool,
10+
CreateDeploymentTool,
11+
ConnectDeploymentTool,
12+
];

src/tools/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { AtlasTools } from "./atlas/tools.js";
22
import { AtlasLocalTools } from "./atlasLocal/tools.js";
33
import { MongoDbTools } from "./mongodb/tools.js";
4+
import type { ToolClass } from "./tool.js";
45

5-
const AllTools = [...MongoDbTools, ...AtlasTools, ...AtlasLocalTools];
6+
const AllTools: ToolClass[] = [...MongoDbTools, ...AtlasTools, ...AtlasLocalTools];
67

78
export { AllTools, MongoDbTools, AtlasTools, AtlasLocalTools };
89

src/tools/mongodb/tools.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ import { LogsTool } from "./metadata/logs.js";
2121
import { ExportTool } from "./read/export.js";
2222
import { DropIndexTool } from "./delete/dropIndex.js";
2323
import { SwitchConnectionTool } from "./connect/switchConnection.js";
24+
import type { ToolClass } from "../tool.js";
2425

25-
export const MongoDbTools = [
26+
export const MongoDbTools: ToolClass[] = [
2627
ConnectTool,
2728
SwitchConnectionTool,
2829
ListCollectionsTool,

0 commit comments

Comments
 (0)