Skip to content

Commit 3b9e595

Browse files
committed
rename atlas metadata
1 parent c5ec47e commit 3b9e595

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/telemetry/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,17 @@ export type CommonProperties = {
141141
* For MongoDB tools, this is typically empty, while for Atlas tools, this should include
142142
* the project and organization IDs if available.
143143
*/
144-
export type TelemetryToolMetadata = AtlasLocalToolMetadata | AtlasToolMetadata | PerfAdvisorToolMetadata;
144+
export type TelemetryToolMetadata = AtlasLocalToolMetadata | AtlasMetadata | PerfAdvisorToolMetadata;
145145

146146
export type AtlasLocalToolMetadata = {
147147
atlas_local_deployment_id?: string;
148148
};
149149

150-
export type AtlasToolMetadata = {
150+
export type AtlasMetadata = {
151151
project_id?: string;
152152
org_id?: string;
153153
};
154154

155-
export type PerfAdvisorToolMetadata = AtlasToolMetadata & {
155+
export type PerfAdvisorToolMetadata = AtlasMetadata & {
156156
operations: string[];
157157
};

src/tools/atlas/atlasTool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ToolCallback } from "@modelcontextprotocol/sdk/server/mcp.js";
2-
import type { AtlasToolMetadata } from "../../telemetry/types.js";
2+
import type { AtlasMetadata } from "../../telemetry/types.js";
33
import { ToolBase, type ToolArgs, type ToolCategory } from "../tool.js";
44
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
55
import { LogId } from "../../common/logger.js";
@@ -82,8 +82,8 @@ For more information on Atlas API access roles, visit: https://www.mongodb.com/d
8282
* @param args - The arguments passed to the tool
8383
* @returns The tool metadata
8484
*/
85-
protected resolveTelemetryMetadata(...args: Parameters<ToolCallback<typeof this.argsShape>>): AtlasToolMetadata {
86-
const toolMetadata: AtlasToolMetadata = {};
85+
protected resolveTelemetryMetadata(...args: Parameters<ToolCallback<typeof this.argsShape>>): AtlasMetadata {
86+
const toolMetadata: AtlasMetadata = {};
8787
if (!args.length) {
8888
return toolMetadata;
8989
}

src/tools/mongodb/mongodbTool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
66
import { ErrorCodes, MongoDBError } from "../../common/errors.js";
77
import { LogId } from "../../common/logger.js";
88
import type { Server } from "../../server.js";
9-
import type { AtlasToolMetadata } from "../../telemetry/types.js";
9+
import type { AtlasMetadata } from "../../telemetry/types.js";
1010

1111
export const DbOperationArgs = {
1212
database: z.string().describe("Database name"),
@@ -114,8 +114,8 @@ export abstract class MongoDBToolBase extends ToolBase {
114114
protected resolveTelemetryMetadata(
115115
// eslint-disable-next-line @typescript-eslint/no-unused-vars
116116
args: ToolArgs<typeof this.argsShape>
117-
): AtlasToolMetadata {
118-
const metadata: AtlasToolMetadata = {};
117+
): AtlasMetadata {
118+
const metadata: AtlasMetadata = {};
119119

120120
// Add projectId to the metadata if running a MongoDB operation to an Atlas cluster
121121
if (this.session.connectedAtlasCluster?.projectId) {

tests/unit/toolBase.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ class TestTool extends ToolBase {
198198
});
199199
}
200200

201-
protected resolveTelemetryMetadata(
202-
result: CallToolResult,
203-
args: ToolArgs<typeof this.argsShape>
204-
): TelemetryToolMetadata {
201+
protected resolveTelemetryMetadata(args: ToolArgs<typeof this.argsShape>): TelemetryToolMetadata {
205202
if (args.param2 === 3) {
206203
return {
207204
test_param2: "three",

0 commit comments

Comments
 (0)