feat(mcp): add list and get tools for saved queries and query history#40301
Draft
aminghadersohi wants to merge 1 commit into
Draft
feat(mcp): add list and get tools for saved queries and query history#40301aminghadersohi wants to merge 1 commit into
aminghadersohi wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #40301 +/- ##
========================================
Coverage 64.19% 64.19%
========================================
Files 2591 2599 +8
Lines 138459 138757 +298
Branches 32118 32130 +12
========================================
+ Hits 88880 89080 +200
- Misses 48047 48143 +96
- Partials 1532 1534 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
89aa7b3 to
af5a7f6
Compare
Implements list_saved_queries, get_saved_query_info, list_queries, and get_query_info MCP tools in new saved_query/ and query/ domains. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
af5a7f6 to
d501ad2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SUMMARY
Adds four new MCP tools across two new domains (
saved_query/andquery/):list_saved_queries— List saved SQL queries owned by the current user with filtering (label, db_id, schema), search, and paginationget_saved_query_info— Get saved query details by numeric ID or UUIDlist_queries— List SQL query history with filtering (status, database_id, schema), defaulting to most-recent-first (ordered bystart_timedesc, page_size 25)get_query_info— Get query history details by numeric IDBoth domains follow the existing
database/,dataset/,chart/, anddashboard/patterns:ModelListCore/ModelGetInfoCorefor reuse, Pydantic schemas with field-level serialization context,@tooldecorators with RBAC, andevent_loggerinstrumentation.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend API tools only
TESTING INSTRUCTIONS
# Run unit tests for the new tools pytest tests/unit_tests/mcp_service/saved_query/ pytest tests/unit_tests/mcp_service/query/ADDITIONAL INFORMATION