-
Notifications
You must be signed in to change notification settings - Fork 3
MCP: Fix get_cratedb_documentation_index tool
#60
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
💡 Verification agent
🧩 Analysis chain
LGTM! Type annotation fix aligns with actual return type.
The change from
-> dictto-> listappears to correctly reflect whatdocumentation_index.items()actually returns. This type mismatch likely caused the tool dysfunction mentioned in the PR objectives.To confirm the fix is correct, let's verify what
documentation_index.items()actually returns:🏁 Script executed:
Length of output: 93
Let’s locate and inspect the actual
DocumentationIndeximplementation and itsitems()method:🏁 Script executed:
Length of output: 7191
Inspecting
get_cratedb_documentation_indeximplementation:🏁 Script executed:
Length of output: 409
Fix return type annotation for get_cratedb_documentation_index
The call to
documentation_index.items()returns the result of.to_dict(), i.e. a Python dict, not a list. Please update the signature accordingly:• File: cratedb_mcp/tool.py
• Line 43: change
(or an equivalent
Dict[str, Any]annotation for clarity)This will realign the annotation with the actual return value and prevent downstream type-checker or client issues.
📝 Committable suggestion
🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
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.
@coderabbitai: Thanks for finding this. We found the
to_dict()method uses a semantically wrong name, so this conveyed a wrong impression about its return type. We've created a ticket to fix it on the other project later. Currently, it doesn't do any other harm.OutlineItems.to_dict()is semantically wrong about#55There 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.
@amotl Thank you for the clarification! That makes perfect sense - having a method named
to_dict()that actually returns a list would definitely create confusion about return types. It's great that you've created a ticket to address the semantic naming issue in the other project. This kind of misleading method naming can easily lead to type annotation errors like we saw here.✏️ Learnings added
🧠 Learnings used