Skip to main content
Glama

Filter, group and sort rows

sheet_query

Query .xlsx or .csv files by path, applying filters, grouping, aggregation, and sorting in one call. Use this when standard file readers cannot parse spreadsheet formats.

Instructions

Call this tool for any spreadsheet or CSV file path; built-in file readers cannot parse spreadsheets and must not be used for them. Filters, groups, aggregates and sorts in one call, e.g. where '[Qty] > 10'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asNo
pathYesPath to the .xlsx or .csv file
sortNoSort column; may be an aggregate alias such as total_units
limitNoDefault 100
sheetNo
whereNoFilter, e.g. [Qty] >= 5 AND ([Status] = "open" OR [Status] = "new")
selectNoColumn names to return; default all (with group_by, defaults to the group columns plus the aggregates)
group_byNoGroup rows by these columns before aggregating, e.g. ["Rep"] or ["Region","Rep"]
aggregateNoAggregates per group, e.g. [{"col":"Units","fn":"sum","as":"total_units"}]. Defaults to a row count when group_by is given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.20.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden. It discloses that the tool parses spreadspreadsheets and performs filter/group/aggregate/sort operations in one call. It does not state whether the file is modified, nor describe output shape or defaults, but the query-oriented wording implies a read-only transformation, leaving room for more transparency.

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?

Two sentences with no filler: the first routes to the right class of files, the second states the core multi-operation behavior and gives a concrete filter example. It is front-loaded and every sentence earns its place.

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

Completeness3/5

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

The tool has 9 parameters, nested aggregate objects, and no output schema, so a minimal viable description needs more than two sentences. The schema covers most parameters, but the description does not explain return shape, default limit, or when to prefer sibling tools like sheet_read or sheet_stats. It is adequate but has clear gaps.

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 78%, so most parameters are already documented. The description adds the helpful where-syntax example ('[Qty] > 10') and reinforces the combined query capability, but it adds no meaning beyond the schema for group_by, aggregate, sort, or the as output enum. Baseline 3 is appropriate.

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 uses specific operation verbs ('Filters, groups, aggregates and sorts in one call') and identifies the target resource (spreadsheet or CSV path). It also clearly distances itself from built-in file readers. However, it does not explicitly contrast with sibling spreadsheet tools like sheet_read, sheet_stats, or sheet_find, so it stops short of full sibling differentiation.

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 description gives explicit routing: call this tool for any spreadsheet or CSV file path, and warns that built-in file readers must not be used for them. This is clearer than implied usage. It lacks explicit guidance on when to choose this over sibling sheet_* tools, but it does provide a clear context and an exclusion.

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