Skip to main content
Glama
ChingEnLin
by ChingEnLin

distinct_values

Read-only

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
tableYes
whereNo
columnYes
schemaNo
databaseNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the tool read-only and non-destructive. The description adds behavioral context about output ordering (frequencies, most common first), default limit, and schema/database fallback behavior, which goes beyond the annotations and enriches understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise and well-structured: a one-sentence summary, a use-case note, and a labeled Args list. Every sentence is informative and there is no fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description adequately covers the tool's purpose, parameter semantics, defaults, and behavioral nuances. For a read-only analytical tool, this is complete enough for an agent to select and invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description includes an 'Args' section that explains every parameter in plain language, including meaning, optionality, and defaults. This fully compensates for the schema's lack of descriptions and provides clear usage guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool gets distinct values of a column with their frequencies, ordered most common first. This specific verb-resource combination distinguishes it from siblings like sample_rows, count_rows, and describe_table.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says the tool is useful for understanding enums, categories, and cardinality, giving clear context for when to use it. However, it does not mention any alternatives or exclusions compared to sibling tools, so it stops short of full when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ChingEnLin/SQMCPaL'

If you have feedback or need assistance with the MCP directory API, please join our Discord server