Skip to main content
Glama

Analyze Categorical

analyze_categorical

Analyze categorical text columns in a dataset by counting unique and missing values, identifying top N frequent entries, and returning distribution percentages for data profiling.

Instructions

Analyze frequency, cardinality, and distribution of categorical (text) columns. Args: dataset_id (str): ID of the dataset. top_n (int): How many of the most frequent values are listed per column. Default is 10. Returns: dict: For each categorical column: unique count, most frequent value and its count, missing count, and the percentages of the top_n values.

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": "analyze_categorical"
  }
}

Input Schema

NameRequiredDescriptionDefault
top_nNo
dataset_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose the return structure well (per-column unique count, top value and count, missing count, top_n percentages), which is genuine behavioral value, but it says nothing about read-only semantics, side effects, performance on high-cardinality columns, or error conditions.

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

Conciseness4/5

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

The Google-style Args/Returns layout is front-loaded with the purpose and keeps each line informative. The wording is tight; only minor redundancy between the summary sentence and the Returns block.

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?

With no output schema, the description correctly fills that gap by describing the returned dict per column. Given only two parameters and a read-only analysis operation, the definition is close to complete, missing only error/edge-case behavior.

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: dataset_id is identified as the dataset ID and top_n is explained as how many of the most frequent values are listed per column, matching the schema default of 10.

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 description opens with a specific verb and resource: analyze frequency, cardinality, and distribution of categorical (text) columns. That is concrete enough to distinguish it from siblings like encode_categorical or analyze_correlation, though it never names an alternative explicitly.

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 implied by the stated purpose (text/categorical columns), but there is no explicit when-to-use guidance, no mention of when to prefer analyze_distribution, column_types, or countplot instead, and no stated prerequisites.

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