Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Atlas list performance advisor tool #609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kylelai1 wants to merge 7 commits into main
base: main
Choose a base branch
Loading
from atlas-list-performance-advisor-tool

Conversation

Copy link
Collaborator

@kylelai1 kylelai1 commented Oct 3, 2025
edited
Loading

Proposed changes

Checklist

}
}

export async function deleteCluster(
Copy link
Collaborator Author

@kylelai1 kylelai1 Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved deleteCluster and waitCluster to atlasHelpers.ts

@kylelai1 kylelai1 changed the title (削除) [WIP] feat: Atlas list performance advisor tool (削除ここまで) (追記) feat: Atlas list performance advisor tool (追記ここまで) Oct 3, 2025
@kylelai1 kylelai1 marked this pull request as ready for review October 6, 2025 04:28
@kylelai1 kylelai1 requested a review from a team as a code owner October 6, 2025 04:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new Atlas performance advisor tool (atlas-get-performance-advisor) to the MCP server, enabling users to retrieve MongoDB Atlas performance recommendations including suggested indexes, drop index suggestions, slow query logs, and schema suggestions.

  • Implements a comprehensive performance advisor tool that supports multiple operation types
  • Adds supporting utilities for Atlas performance advisor API integration
  • Includes extensive integration and accuracy test coverage

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/tools/atlas/read/getPerformanceAdvisor.ts Main implementation of the performance advisor tool with support for multiple operation types
src/common/atlas/performanceAdvisorUtils.ts Utility functions for interacting with Atlas performance advisor APIs
src/common/atlas/cluster.ts Enhanced cluster functionality to extract process IDs from connection strings
src/common/atlas/apiClient.ts Added API client methods for performance advisor endpoints
tests/integration/tools/atlas/performanceAdvisor.test.ts Integration tests for the performance advisor tool
tests/accuracy/listPerformanceAdvisor.test.ts Accuracy tests to ensure correct tool usage by LLMs


export class GetPerformanceAdvisorTool extends AtlasToolBase {
public name = "atlas-get-performance-advisor";
protected description = `Get MongoDB Atlas performance advisor recommendations, which includes the operations: suggested indexes, drop index suggestions, schema suggestions, and a sample of the most recent (max ${DEFAULT_SLOW_QUERY_LOGS_LIMIT}) slow query logs`;
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool name should follow the naming convention of describing an action. Consider changing 'atlas-get-performance-advisor' to 'atlas-list-performance-advisor' to be consistent with other listing tools.

Copilot generated this review using guidance from repository custom instructions.

Comment on lines 85 to 87
dropIndexSuggestionsResult.value.hiddenIndexes.length > 0 &&
dropIndexSuggestionsResult.value.redundantIndexes.length > 0 &&
dropIndexSuggestionsResult.value.unusedIndexes.length > 0;
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for hasDropIndexSuggestions is incorrect. It requires ALL three arrays (hidden, redundant, and unused indexes) to have data, when it should return true if ANY of them have data. Change the && operators on lines 85-87 to ||.

Suggested change
dropIndexSuggestionsResult.value.hiddenIndexes.length > 0 &&
dropIndexSuggestionsResult.value.redundantIndexes.length > 0 &&
dropIndexSuggestionsResult.value.unusedIndexes.length > 0;
(
dropIndexSuggestionsResult.value.hiddenIndexes.length > 0 ||
dropIndexSuggestionsResult.value.redundantIndexes.length > 0 ||
dropIndexSuggestionsResult.value.unusedIndexes.length > 0
);

Copilot uses AI. Check for mistakes.

},
},
{
toolName: "atlas-list-performance-advisor",
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent tool name in accuracy tests. The actual tool is named 'atlas-get-performance-advisor' but the test expects 'atlas-list-performance-advisor'. This mismatch will cause test failures.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

Copilot code review Copilot Copilot left review comments

@nirinchev nirinchev nirinchev approved these changes

@kmruiz kmruiz Awaiting requested review from kmruiz

@blva blva Awaiting requested review from blva

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /