columnDistribution
columnDistributionAnalyze a column's value distribution by returning top-N values, their counts, and row shares to identify frequency and skew in a table.
Instructions
Measure value frequency and skew for one known column by returning top-N values, counts and row shares. Use columnStats for only cardinality/extremes; runs GROUP BY + COUNT and may be expensive on large tables.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"connection": "<connection>",
"table": "<table>",
"column": "<column>"
},
"name": "columnDistribution"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topN | No | Top values to return (default 20, max 1000). | |
| table | Yes | ||
| column | Yes | ||
| schema | No | ||
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topN | Yes | Maximum number of most-frequent values requested for the distribution. | |
| table | No | ||
| column | No | Column whose value frequencies were measured. | |
| schema | No | ||
| values | No | Most frequent values and their frequencies for the column. | |
| topRows | Yes | Rows covered by the returned top-N value buckets. | |
| topRatio | Yes | Share of all rows covered by the returned top-N buckets, from 0.0 to 1.0. | |
| otherRows | Yes | Rows not represented by the returned top-N value buckets. | |
| totalRows | Yes | Total number of rows considered for this statistic. | |
| otherRatio | Yes | Share of all rows outside the returned top-N buckets, from 0.0 to 1.0. |