[#12371] feat(mcp-server): write tools for views - #12372
Draft
bharos wants to merge 1 commit into
Draft
Conversation
bharos
marked this pull request as draft
August 5, 2026 06:22
Add create_view, alter_view and drop_view tools backed by the existing ViewOperations REST endpoints, so view has the same write coverage as the other schema-level entities.
bharos
force-pushed
the
mcp-view-write-tools
branch
from
August 5, 2026 06:58
f14996b to
1275ad9
Compare
bharos
marked this pull request as ready for review
August 5, 2026 07:04
Code Coverage Report
|
Contributor
Contributor
Author
Got it, I Thought we were supporting write operations as well. No, I don't have any immediate need. We can wait on this PR until we decide to support write tools |
bharos
marked this pull request as draft
August 10, 2026 22:55
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.
What changes were proposed in this pull request?
Add
create_view,alter_viewanddrop_viewMCP tools, following the existingpattern:
ViewOperationinterface ->PlainRESTClientViewOperation-> FastMCPtools in
tools/view.py, plus mock and unit tests. They call the existingViewOperationsREST endpoints, so no server-side change is needed. The tooltable in
docs/gravitino-mcp-server.mdis updated.Why are the changes needed?
View is the only schema-level entity in the MCP server with read tools but no
write tools: catalog, schema, table and fileset have create/alter/drop, and
topic, model and tag have their equivalents. #12129 added
list_of_viewsandload_viewand left the write side as a follow-up.Fix: #12371
Does this PR introduce any user-facing change?
Yes, three new MCP tools. They carry the existing
viewtag, so--include-tool-tags viewpicks them up. No new configuration.How was this patch tested?
Unit tests: 3 tool tests plus 3 client tests covering URL encoding of the view
name, omission of unset
default_catalog/default_schema, and thedroppedresponse key. Full suite is 173 tests; isort, black and pylint (10.00/10) clean.
End to end against a local Gravitino with a
lakehouse-icebergcatalog (JDBCbackend), driving the MCP server over
streamable-httpwith a real client:create (both with and without the optional defaults) ->
list_of_views->alter_viewwithsetPropertyandrename->load_view->drop_view.drop_viewreturnstruefor an existing view andfalsefor a missing one,and a create with empty
representationssurfaces the server's validationerror as a tool error. Full results are recorded in
#12371 (comment)