Skip to main content
Glama
xlsx-for-ai

xlsx-for-ai

by senoff

xlsx_value_counts

Read-onlyIdempotent

Counts each unique value in a spreadsheet column, sorted by frequency with percentages. Use it to profile data distribution and spot dominant or rare entries in .xlsx files.

Instructions

Use this when you need per-column value counts — each unique value, sorted by frequency, with percentage.

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": {
      "file_path": "<file_path>",
      "column": "<column>"
    },
    "name": "xlsx_value_counts"
  }
}

Input Schema

NameRequiredDescriptionDefault
sheetNoSheet name (default: first sheet).
top_nNoShow top N most-frequent values (default 50).
columnYesColumn to count values in.
file_pathYesAbsolute path to the .xlsx file. Pass the path string AS-IS — do NOT read, open, or base64-encode the file; the client handles all file I/O. The base64 surface in this connector is OUTPUT-only (_meta.file_b64).
header_rowNoHeader row (1-based). 0 = treat row 1 as data, no header.
include_nullsNoCount null cells as a distinct value (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv4.3.1
    • addedInput schema / properties / column / description
      Added value: +"Column to count values in."
    • removedInput schema / properties / file_b64
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / file_path
      Added value: +{
      +  "description": "Absolute path to the .xlsx file. Pass the path string AS-IS — do NOT read, open, or base64-encode the file; the client handles all file I/O. The base64 surface in this connector is OUTPUT-only (_meta.file_b64).",
      +  "type": "string"
      +}
    • addedInput schema / properties / header_row
      Added value: +{
      +  "description": "Header row (1-based). 0 = treat row 1 as data, no header.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / include_nulls
      Added value: +{
      +  "description": "Count null cells as a distinct value (default false).",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / options
      Removed value: -{
      -  "properties": {
      -    "header_row": {
      -      "minimum": 0,
      -      "type": "integer"
      -    },
      -    "include_nulls": {
      -      "type": "boolean"
      -    },
      -    "sheet": {
      -      "type": "string"
      -    },
      -    "top_n": {
      -      "maximum": 1000,
      -      "minimum": 1,
      -      "type": "integer"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedInput schema / properties / sheet
      Added value: +{
      +  "description": "Sheet name (default: first sheet).",
      +  "type": "string"
      +}
    • addedInput schema / properties / top_n
      Added value: +{
      +  "default": 50,
      +  "description": "Show top N most-frequent values (default 50).",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "column",
      -  "file_b64"
      -]New value: +[
      +  "file_path",
      +  "column"
      +]
  2. First observedv3.2.1

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety is fully covered. The description adds useful output semantics — values sorted by frequency with a percentage column — that annotations do not express. It says nothing about truncation to top_n or how nulls appear in the result, which are the remaining behavioral unknowns.

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?

A single front-loaded sentence that states the trigger condition first and then the output characteristics. Nothing is redundant with the name or annotations.

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?

For a read-only counting tool with no output schema, the description conveys both the intent and the shape of the result, which is the main thing an agent needs. The only gap is that it does not warn that results are capped at top_n entries, leaving the agent to infer truncation from the schema default.

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 every parameter including sheet, top_n, header_row and include_nulls is already documented inline. The description only implies the column parameter via 'per-column' and adds no format or syntax detail beyond the schema, so the baseline 3 applies.

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 names a specific operation and resource — per-column value counts over an Excel sheet — and even sketches the result shape (unique value, frequency, percentage). It is clearly distinguishable from aggregation or filtering siblings, though it never names a sibling to contrast with.

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?

The lead-in 'Use this when you need per-column value counts' is an implied trigger condition, but there is no when-not guidance and no routing to alternatives such as xlsx_aggregate or xlsx_filter for grouped statistics. An agent must infer the boundaries itself.

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