Skip to main content
Glama

get_value_counts

Analyze frequency distribution of values in a column to understand categorical data patterns, identify common values, and assess data quality with configurable counts or percentages.

Instructions

Get frequency distribution of values in a column.

Analyzes the distribution of values in a specified column, providing counts and optionally percentages for each unique value. Essential for understanding categorical data and identifying common patterns.

Returns: Frequency distribution with counts/percentages for each unique value

Analysis Features: 🔢 Frequency Counts: Raw counts for each unique value 📊 Percentage Mode: Normalized frequencies as percentages 🎯 Top Values: Configurable limit for most frequent values 📈 Summary Stats: Total values, unique count, distribution insights

Examples: # Basic value counts counts = await get_value_counts(ctx, "category")

# Get percentages for top 10 values
counts = await get_value_counts(ctx, "status",
                              normalize=True, top_n=10)

# Sort in ascending order
counts = await get_value_counts(ctx, "grade", ascending=True)

AI Workflow Integration: 1. Categorical data analysis and encoding decisions 2. Data quality assessment (identifying rare values) 3. Understanding distribution for sampling strategies 4. Feature engineering insights for categorical variables

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYesName of the column to analyze value distribution
normalizeYesReturn percentages instead of raw counts
sortYesSort results by frequency
ascendingYesSort in ascending order (False = descending)
top_nYesMaximum number of values to return (None = all values)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYesName of the analyzed column
successNoWhether operation completed successfully
normalizeNoWhether counts are normalized as proportions
total_valuesYesTotal number of values (including duplicates)
value_countsYesCount or proportion of each unique value
unique_valuesYesNumber of unique/distinct values
Behavior3/5

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

With no annotations provided, the description carries full burden. It describes what the tool returns ('frequency distribution with counts/percentages') and lists analysis features, but doesn't disclose important behavioral traits like whether this is a read-only operation, performance characteristics, data size limitations, or error conditions. The description adds useful context about what the tool provides but misses key operational details.

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

Conciseness3/5

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

The description is well-structured with clear sections, but contains some redundancy. The 'Returns' section repeats information from the opening paragraph, and the 'Analysis Features' section uses emojis that don't add semantic value. The examples and workflow integration sections are helpful but could be more concise while maintaining clarity.

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?

Given the tool's moderate complexity (5 parameters, no annotations, but with output schema), the description is reasonably complete. It explains the tool's purpose, provides usage examples, and outlines integration scenarios. The presence of an output schema means the description doesn't need to detail return values. However, for a data analysis tool with no annotations, more behavioral context would be beneficial.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds minimal value beyond the schema through the examples section, which shows practical usage patterns. However, it doesn't provide additional semantic context or edge cases not already covered in the parameter descriptions.

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's purpose: 'Get frequency distribution of values in a column' with specific verbs ('analyzes', 'providing') and resource ('column'). It distinguishes from siblings like get_column_statistics or get_data_summary by focusing specifically on value frequency analysis rather than general statistics.

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 'AI Workflow Integration' section provides clear context for when to use this tool (categorical data analysis, data quality assessment, sampling strategies, feature engineering). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for similar tasks.

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/jonpspri/databeak'

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