Skip to main content
Glama

crosstab

Cross-tabulates two categorical columns to reveal relationships, with optional normalization to percentages for proportional analysis.

Instructions

Cross-tabulation of two categorical columns. Optional normalization (percentages). Understand relationships between two categorical variables. Set normalize=True to see percentages instead of raw counts. Example: crosstab(index_col="City", columns_col="Category", normalize=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
df_nameNo
index_colYes
normalizeNo
columns_colYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the burden of behavioral disclosure. It adds value by explaining that normalize=True shows percentages instead of raw counts, which is a key behavior. However, it does not mention how missing values are handled, how the table is structured, or any potential side effects, leaving some gaps for an unannotated read-analysis tool.

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 three sentences plus a concise example, with the core function stated in the first sentence. Every sentence earns its place, and no unnecessary information is included.

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?

This is a relatively simple bivariate analysis tool with an output schema present. The description covers the purpose, usage, and normalization behavior, which is sufficient for basic invocation. The lack of df_name explanation is a minor gap, but overall the description is complete enough given the tool's simplicity.

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 0%, so the description must compensate. It explains index_col, columns_col, and normalize (via the example and the normalize=True note). However, it does not explain df_name at all, leaving a required parameter (defaulting to '') ambiguous. The example helps but does not fully offset the missing df_name semantics.

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 opens with 'Cross-tabulation of two categorical columns', which uses a specific verb and resource, clearly distinguishing it from sibling tools like pivot_table or get_value_counts. It also immediately mentions optional normalization, further clarifying its primary function.

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 phrase 'Understand relationships between two categorical variables' provides clear context for when to use this tool. It does not explicitly mention alternatives or exclusions, but the use case is well implied for an agent selecting among similar analysis tools.

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/AstyanM/mcp-data-science'

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