Skip to main content
Glama

get_value_counts

Analyze frequency distribution of column values 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

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)

Input Schema (JSON Schema)

{ "properties": { "ascending": { "description": "Sort in ascending order (False = descending)", "type": "boolean" }, "column": { "description": "Name of the column to analyze value distribution", "type": "string" }, "normalize": { "description": "Return percentages instead of raw counts", "type": "boolean" }, "sort": { "description": "Sort results by frequency", "type": "boolean" }, "top_n": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "Maximum number of values to return (None = all values)" } }, "required": [ "column", "normalize", "sort", "ascending", "top_n" ], "type": "object" }

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