distinct_values
List distinct values of a database column with occurrence counts, ordered by frequency. Identify categories, enums, and cardinality for data exploration.
Instructions
Get the distinct values of a column with their frequencies, most common first.
Useful for understanding enums, categories and cardinality.
Args: table: Table name. column: Column name. where: Optional WHERE clause body without the WHERE keyword. limit: Max distinct values to return (default 100). schema: Schema name. Defaults to the session schema, then 'public'. database: Database name. Defaults to the session database.
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": {
"table": "<table>",
"column": "<column>"
},
"name": "distinct_values"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| table | Yes | ||
| where | No | ||
| column | Yes | ||
| schema | No | ||
| database | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |