Skip to main content
Glama

Column stats

column_stats
Read-onlyIdempotent

Compute one statistic over a single column: sum, avg, min or max (numeric, rounded to 2 dp, blanks ignored), count of non-empty cells, or the sorted distinct values. Use for quick answers like 'total of the price column'. Do NOT use to reshape the table; use split_column or convert_table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYesStatistic: sum, avg, min, max (column must be numeric), count (non-empty cells) or distinct (unique values).
dataYesThe whole table as text, first row = header. CSV/TSV text (quoted cells allowed), or a JSON array of flat objects, e.g. "name,age\nAsha,30".
columnYesColumn to use: the exact header name (case-sensitive), or a 0-based column index as digits, e.g. "price" or "2".
formatNoFormat of 'data' and of the returned table: csv, tsv or json. Default csv.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYesThe statistic that was computed.
columnYesHeader name of the column that was analysed.
resultYesNumeric result for sum/avg/min/max/count, or a sorted array of distinct string values for distinct.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changed
    • changedInput schema / properties / column / description
      Previous value: -"The column for this request."New value: +"Column to use: the exact header name (case-sensitive), or a 0-based column index as digits, e.g. \"price\" or \"2\"."
    • addedInput schema / properties / column / minLength
      Added value: +1
    • changedInput schema / properties / data / description
      Previous value: -"The data for this request."New value: +"The whole table as text, first row = header. CSV/TSV text (quoted cells allowed), or a JSON array of flat objects, e.g. \"name,age\\nAsha,30\"."
    • addedInput schema / properties / data / minLength
      Added value: +1
    • changedInput schema / properties / format / description
      Previous value: -"The format for this request."New value: +"Format of 'data' and of the returned table: csv, tsv or json. Default csv."
    • addedInput schema / properties / format / enum
      Added value: +[
      +  "csv",
      +  "tsv",
      +  "json"
      +]
    • changedInput schema / properties / op / description
      Previous value: -"The op for this request."New value: +"Statistic: sum, avg, min, max (column must be numeric), count (non-empty cells) or distinct (unique values)."
    • addedInput schema / properties / op / enum
      Added value: +[
      +  "sum",
      +  "avg",
      +  "min",
      +  "max",
      +  "count",
      +  "distinct"
      +]
    • removedOutput schema / properties / avg
      Removed value: -{
      -  "description": "The average of the values in the specified column.",
      -  "type": "number"
      -}
    • addedOutput schema / properties / column
      Added value: +{
      +  "description": "Header name of the column that was analysed.",
      +  "type": "string"
      +}
    • removedOutput schema / properties / count
      Removed value: -{
      -  "description": "The number of values in the specified column.",
      -  "type": "integer"
      -}
    • removedOutput schema / properties / distinct
      Removed value: -{
      -  "description": "The number of distinct values in the specified column.",
      -  "type": "integer"
      -}
    • removedOutput schema / properties / max
      Removed value: -{
      -  "description": "The maximum value in the specified column.",
      -  "type": "number"
      -}
    • removedOutput schema / properties / min
      Removed value: -{
      -  "description": "The minimum value in the specified column.",
      -  "type": "number"
      -}
    • addedOutput schema / properties / op
      Added value: +{
      +  "description": "The statistic that was computed.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / result
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  ],
      +  "description": "Numeric result for sum/avg/min/max/count, or a sorted array of distinct string values for distinct."
      +}
    • removedOutput schema / properties / sum
      Removed value: -{
      -  "description": "The sum of the values in the specified column.",
      -  "type": "number"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "sum",
      -  "avg",
      -  "min",
      -  "max",
      -  "count",
      -  "distinct"
      -]New value: +[
      +  "column",
      +  "op",
      +  "result"
      +]
  2. Changed4 schema fields changed
    • addedInput schema / properties / column / description
      Added value: +"The column for this request."
    • addedInput schema / properties / data / description
      Added value: +"The data for this request."
    • addedInput schema / properties / format / description
      Added value: +"The format for this request."
    • addedInput schema / properties / op / description
      Added value: +"The op for this request."
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "avg": {
      +      "description": "The average of the values in the specified column.",
      +      "type": "number"
      +    },
      +    "count": {
      +      "description": "The number of values in the specified column.",
      +      "type": "integer"
      +    },
      +    "distinct": {
      +      "description": "The number of distinct values in the specified column.",
      +      "type": "integer"
      +    },
      +    "max": {
      +      "description": "The maximum value in the specified column.",
      +      "type": "number"
      +    },
      +    "min": {
      +      "description": "The minimum value in the specified column.",
      +      "type": "number"
      +    },
      +    "sum": {
      +      "description": "The sum of the values in the specified column.",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "sum",
      +    "avg",
      +    "min",
      +    "max",
      +    "count",
      +    "distinct"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description goes beyond that by disclosing rounding to 2 dp, blanks being ignored, count meaning non-empty cells, and distinct values being sorted. It stops short of noting error behavior for non-numeric input on sum/avg, which keeps it from a 5.

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?

Three compact sentences with the operation set front-loaded, followed by positive use case and the exclusion. No filler and no repetition of structured fields.

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

Completeness5/5

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

With an output schema present, return-value explanation is unnecessary, and annotations carry the safety profile. The description supplies purpose, alternatives, and result semantics for a 4-parameter tool, leaving nothing an agent needs to call it correctly.

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 coverage is 100%, so the baseline is 3. The description still adds semantics beyond the enum text: numeric results are rounded to 2 dp, blanks are ignored, count counts non-empty cells, and distinct returns sorted values. That is genuine value over the schema, though the op meanings largely overlap the enum 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?

Names a specific operation (compute one statistic over a single column) and enumerates the exact supported ops (sum/avg/min/max/count/distinct). It also explicitly distinguishes itself from the sibling tools split_column and convert_table, so an agent can route without opening schemas.

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

Usage Guidelines5/5

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

Gives positive guidance ('quick answers like total of the price column') and an explicit exclusion ('Do NOT use to reshape the table; use split_column or convert_table'). This is the when/when-not/alternative pattern at full strength.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.