mcpdata Request an invite

Answers / Problems and fixes

My AI invented a column that isn't in my data. How do I stop it?

Recipe verified on Ran on the public demo (read-only)
Short answer

Make it look before it asks: describe_table lists the real columns and their types. And query through a database, which refuses a column that doesn't exist with an error, instead of letting the model fill the gap with a guess.

Steps

  1. Connect your assistant to the public demo. It's a read-only instance with 10 million synthetic orders, so you can try this before you have your own. In Claude Code:
    claude mcp add --transport http mcpdata-demo https://demo.mcpdata.org/mcp --header "Authorization: Bearer cdb_live_PkVoldus8qcE-hqffjajNZzQwiA7rTHMoR4RLSAxsCE"

    The key is public on purpose: it can only read the demo's sample data. For Claude Desktop, Cursor and other apps, see Connect your AI.

  2. Ask your question. Give your AI this prompt:
    Using mcpdata, check the columns of Demo.Orders first, then total the discount by region.
What your AI does: the tool calls it makes for this prompt, and what came back
describe_table(table_name="Demo.Orders") → 15 columns, 10,005,000 rows
query(table_name="Demo.Orders", group_by=["region"], agg=[{"func": "sum", "column": "discount", "alias": "discount"}]) → refused: Error calling tool 'query': The column name 'discount' is not recognized.

The assistant needs mcpdata connected (step 1) to run the query.

Why this works

Below, a query on a column that doesn't exist (discount) is refused by the database, so the assistant can't quietly make up numbers for it; it can tell you the column isn't there. mcpdata's tool descriptions also tell the assistant to describe a table before querying it.

Related questions