-
Notifications
You must be signed in to change notification settings - Fork 132
chore: method to detect if a cluster support search indexes and expose the same on debug resource MCP-247 MCP-248 #628
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
Conversation
There was a problem hiding this 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 functionality to detect if a connected MongoDB cluster supports search indexes and exposes this information through the debug resource. The changes enable better visibility into cluster capabilities for users.
Key changes:
- Added a new
isSearchIndexSupported()
method to the Session class that tests search index support - Updated the debug resource to display search index support status when connected
- Made the debug resource's
toOutput()
method asynchronous to accommodate the new capability check
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/common/session.ts | Implements the isSearchIndexSupported() method that tests search index capability |
src/resources/common/debug.ts | Updates debug output to show search index support status and makes toOutput() async |
src/resources/resource.ts | Updates base resource class to support async toOutput() method |
tests/unit/common/session.test.ts | Adds unit tests for the new search index support detection method |
tests/unit/resources/common/debug.test.ts | Updates existing tests to handle async toOutput() and adds test for search index support display |
case "connected": | ||
result += "The user is connected to the MongoDB cluster."; | ||
case "connected": { | ||
const searchIndexesSupported = await this.session.isSearchIndexSupported(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind these additions but this seems like a bit of random information to include. What will be the deciding factor in what output we'll show here? I imagine there's a ton of info which could be relevant in that sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far the idea is to have anything connection related that might help Agent debug a problem with tool calls / connectivity problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case - we're expecting Agent to use debug resource at some point when its attempting to do search related work like creating search index. Although the tool call would respond with the appropriate error but there is a good chance of agent pulling debug resource information so we should have search related metadata here as well.
a24977a
to
039471d
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
312ec75
to
8fac3a2
Compare
Proposed changes
Adds a small helper on session to check if search indexes are supported by the connected cluster and adds this information on the debug resource as well.
Checklist