Repository navigation
fix(gti-mcp): return API errors from create and update collection tools - #345
Open
VISHNU0906 wants to merge 1 commit into
Open
VISHNU0906 wants to merge 1 commit into
VISHNU0906 wants to merge 1 commit into
Conversation
create_collection and update_collection_attributes read data["data"] straight from the GTI response. When the API answers with an error payload (403 for an account without collection access, 404 for an unknown collection id), the tool fails with "Error executing tool ...: 'data'" and the API's message is lost. Return an error dict with that message instead, using the same data guard as get_collections_commonalities. Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
This branch has not been deployed
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.
create_collectionandupdate_collection_attributesreturndata["data"]from the GTI response without checking it. When the API sends back an error instead (403 for an account that can't create collections, 404 for an unknown collection id), the tool fails withand the API's message never reaches the client.
This PR returns
{"error": "API Error: <message>"}in that case, using the samedataguard thatget_collections_commonalitiesgot in #335. The success path doesn't change.Testing: new tests call both tools through the MCP client session against the pytest-httpserver mock, with a 403/404 error body, an error body without a message, and
{"data": null}. All five cases fail on main with the'data'error above. The fullserver/gtisuite passes (77 tests).@dandye could you take a look when you have a moment?