Skip to main content
Glama
xlsx-for-ai

xlsx-for-ai

by senoff

xlsx_filter

Read-onlyIdempotent

Filters Excel rows by AND-combined column predicates on formula-evaluated values, returning matching row numbers, NDJSON cache handles, or paginated JSON.

Instructions

Use this when you need a row filter with AND-combined predicates (eq/ne/gt/gte/lt/lte/contains/in/is_null/not_null, or criteria: an Excel criterion matched exactly as COUNTIF does) on real, formula-evaluated cell values. output row_numbers returns the matching sheet rows; rows_handle writes the matching rows as NDJSON to a new cache handle; json returns a page in the xlsx_read json shape.

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>",
      "predicates": "<predicates>"
    },
    "name": "xlsx_filter"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax matching rows to return (default 1000).
sheetNoSheet name (default: first sheet).
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.
predicatesYesAND-combined filter predicates. Each: { column, op, value } where op is eq/ne/gt/gte/lt/lte/contains/not_contains/in/not_in/is_null/not_null.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv4.3.1
    • 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 / limit
      Added value: +{
      +  "default": 1000,
      +  "description": "Max matching rows to return (default 1000).",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • removedInput schema / properties / options
      Removed value: -{
      -  "properties": {
      -    "header_row": {
      -      "minimum": 0,
      -      "type": "integer"
      -    },
      -    "limit": {
      -      "maximum": 1000,
      -      "minimum": 1,
      -      "type": "integer"
      -    },
      -    "sheet": {
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedInput schema / properties / predicates / description
      Added value: +"AND-combined filter predicates. Each: { column, op, value } where op is eq/ne/gt/gte/lt/lte/contains/not_contains/in/not_in/is_null/not_null."
    • removedInput schema / properties / predicates / maxItems
      Removed value: -16
    • addedInput schema / properties / sheet
      Added value: +{
      +  "description": "Sheet name (default: first sheet).",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "file_b64",
      -  "predicates"
      -]New value: +[
      +  "file_path",
      +  "predicates"
      +]
  2. First observedv3.2.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered. The description adds real value beyond that: predicates run against formula-evaluated values, and the rows_handle mode writes NDJSON to a new cache handle, a side effect the annotations do not convey. It does not mention limits beyond the default 1000 or performance characteristics.

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?

Three dense sentences, front-loaded with the usage trigger, then predicate semantics, then return modes. The parenthetical operator list and COUNTIF aside make it cramped but every clause carries information; no filler.

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 takes on the burden of describing return shapes (row_numbers, rows_handle NDJSON handle, paged json in xlsx_read shape). The gap is that the output-mode selector it references is absent from the input schema, leaving the agent unsure how to request a mode.

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 coverage is 100%, so the baseline is 3. The description explains the predicate operator set and COUNTIF-style criteria matching, but it introduces a 'criteria' op and an output mode selector that do not appear in the schema enum or property list, while omitting the schema's not_contains/not_in ops, so it adds meaning but with inconsistencies.

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?

States a specific verb and resource: a row filter over cell values with AND-combined predicates, evaluated on formula results. It is clear what the tool does, though it never explicitly contrasts itself with xlsx_read or xlsx_aggregate by name, leaving sibling differentiation to inference.

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 opening 'Use this when you need a row filter with AND-combined predicates' gives an explicit trigger condition, and the three output modes clarify the usage variants. It stops short of stating when not to use it or naming the alternative tool for aggregation or plain reading.

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