shimonp opened a new issue, #40715: URL: https://github.com/apache/superset/issues/40715
### Bug description Original request to the tool from opencode: "Create a dataset "test" from "select * from dim_account"". Manual creation works fine. Opencode reported the following error returned from MCP (create_virtual_dataset tool): Error calling tool 'create_virtual_dataset': 'tables' Assessment: This is a bare Python KeyError: 'tables' bubbling up from the tool implementation. The tool is likely trying to access a 'tables' key from the API response (e.g., response['tables']) and that key is missing or has a different name. This is a bug — the error is not caught and surfaced with a meaningful message. 1. Error message is opaque — 'tables' with no context tells the user nothing about what went wrong. 2. No indication of whether the dataset was partially created — unclear if cleanup is needed (manual check shows taht dataset is not created, though not sure if it was partially created) 3. Possible root cause — the create_virtual_dataset tool parses a Superset API response and assumes a tables key exists, which may be absent when the SQL uses a three-part name (catalog.schema.table) or when the database backend returns a different schema. ### Screenshots/recordings _No response_ ### Superset version master / latest-dev ### Python version 3.9 ### Node version 16 ### Browser Chrome ### Additional context I could not find immediate source of the error in the code. Need someone who understands how MCP transforms create_virtual_dataset into full created dataset. In the same environment manual creation of the dataset works fine. Using API create dataset works as well. It's somewhere between MCP's mechanism and real API call of Superset (schema changed?) opencode complains on "tables" parameter, but I cannot find where tables returned from the call while building response. ### Checklist - [x] I have searched Superset docs and Slack and didn't find a solution to my problem. - [x] I have searched the GitHub issue tracker and didn't find a similar bug report. - [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
