Repository navigation
Agent using MCP cannot properly compute metrics #40920
Replies: 2 comments
|
Yes, these are known limitations of the MCP server's metric handling that have been actively worked on. A few things to be aware of: The The non-existent column references (e.g., referencing a "count" column that doesn't exist) happen because the MCP's metric schema previously only supported fixed aggregate functions ( Custom SQL metric support was added in PR #40448 (merged May 28, 2026), which introduced a There's also a related feature request (#40917) that documents the broader gap around Custom SQL metrics and virtual dataset limitations [3]. Suggestions:
To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
|
The agent invents a "count" column because it is being asked to write the aggregation itself. One way around this is to let it pick field names only and have a planner generate the SQL. That is what 0sql does (disclosure: I work on it). The agent sends: {
"projections": [
{ "field": "category" },
{ "field": "row count" }
]
}And gets back: SELECT T0.category AS "Category",
count(*) AS "Row Count"
FROM orders T0
GROUP BY T0.category"Row count" is defined once in the model as count(*), so the agent never needs to know how it is implemented. If it asks for a field that doesn't exist, it gets a refusal with the nearest valid fields instead of SQL containing a made-up column. For Superset, you would put the returned SQL into a virtual dataset or SQL Lab rather than the chart API. Its free to use: https://0sql.io/ |
Uh oh!
There was an error while loading. Please reload this page.
Hi
I am trying out an agent using superset MCP.
Somehow, whenever I ask it to create a chart with some aggregated values, it either uses an existing metric but omits the "saved_metric: True" parameter, or it writes the aggregation SQL on the fly, but always references a non existing column (for example, if I ask it to count the number of rows per category or per day, it will reference the in existing column "count").
Has anyone else had issues with this ?
All reactions