Skip to content

Conversation

@sragrawal
Copy link
Member

…s semantic models to convert the user's natural language query into a SQL query and then executes it

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • [X ] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested using the MCP functionality in Cline
    I had a schema with a bunch of our ML benchmark datasets
    Q -> What percentage of credit card customers committed fraud?
    This is what ask_nl_sql tool generated
    "sql_query": "SELECT (COUNT(CASE WHEN Class = 1 THEN 1 END) / COUNT()) * 100 AS percentage_fraudulent FROM ml_benchmark.creditcard_train;", "is_sql_valid": 1, "sql_response": "null"
    MCP now took over. First attempt (FAILED)
    SELECT (COUNT(CASE WHEN Class = 1 THEN 1 END) / COUNT(
    )) * 100 AS percentage_fraudulent FROM ml_benchmark.creditcard_train;
    Error executing SQL: Object of type Decimal is not JSON serializable
    Second attempt (FAILED)
    SELECT ROUND((COUNT(CASE WHEN Class = 1 THEN 1 END) / COUNT()) * 100, 4) AS percentage_fraudulent FROM ml_benchmark.creditcard_train;
    Error executing SQL: Object of type Decimal is not JSON serializable
    Third attempt (SUCCESS)
    SELECT FORMAT((COUNT(CASE WHEN Class = 1 THEN 1 END) / COUNT(
    )) * 100, 4) AS percentage_fraudulent FROM ml_benchmark.creditcard_train;
    [["0.1700"]]

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

…s semantic models to convert the user's natural language query into a SQL query and then executes it
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 6, 2025
@sragrawal
Copy link
Member Author

Reviewers are @ay0407 and @GregorySHowe

@ay0407
Copy link
Member

ay0407 commented Nov 6, 2025

I think at some point we need to make an effort to change all returns from tools as strings (e.g., return str(result)).
Approve it otherwise.

@krisrice krisrice merged commit 8fd532b into oracle:main Nov 7, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants