Skip to main content
Glama

Value Counts

value_counts

Calculate frequency counts or proportions for a dataset column, or for every categorical column, with optional top-N results to profile value distributions.

Instructions

Calculate frequency counts for the values of a column, or of every categorical column. Args: dataset_id (str): ID of the dataset. column (str, optional): Column to count. If omitted, every categorical (text) column is counted. top_n (int, optional): Only return the n most frequent values per column. normalize (bool): Return proportions instead of counts. Default is False. Returns: dict: category_columns_unique_values_and_counts, a list with one {column: {value: count}} entry per column.

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": {
      "dataset_id": "<dataset_id>"
    },
    "name": "value_counts"
  }
}

Input Schema

NameRequiredDescriptionDefault
top_nNo
columnNo
normalizeNo
dataset_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the default for `normalize` and the per-column result shape, but says nothing about how nulls/missing values are treated, how ties at the `top_n` boundary are broken, or what happens if `column` is not categorical or does not exist.

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 purpose is front-loaded in one sentence, then Args and Returns blocks in a consistent docstring layout. Every line adds information; there is no filler or restated tool title.

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

Completeness4/5

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

There is no output schema, but the Returns block describes the returned dict and the per-column entry structure, so an agent knows what to expect. Remaining gaps are edge-case behavior (nulls, non-categorical input, empty results) rather than anything blocking a correct call.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it does: all four parameters are explained, including that `column` is optional and triggers all-categorical mode, that `top_n` caps values per column, and that `normalize` swaps counts for proportions. It loses a point only because it repeats raw types without adding validation or error semantics.

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

Purpose4/5

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

The first sentence gives a specific verb and resource ('Calculate frequency counts') and explicitly states the two modes: one named column, or every categorical column. It never names a sibling such as analyze_categorical, so an agent must infer differentiation from its own knowledge of the catalog.

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

Usage Guidelines3/5

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

Usage is only implied: the description explains that omitting `column` counts every text column, which hints at when each mode applies, but there is no explicit when-to-use or when-not-to-use guidance versus alternatives like analyze_categorical or column_types.

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

Deploy Server

Other Tools