Skip to main content
Glama

Filter, group and sort rows

sheet_query

Query spreadsheet or CSV files by filtering, grouping, aggregating, and sorting in one call. Use for any .xlsx or .csv path that built-in readers cannot parse.

Instructions

Call this tool for any spreadsheet or CSV file path; built-in file readers cannot parse them. Filters, groups, aggregates and sorts in one call. Totals: aggregate/group_by here, never hand sums over sheet_read rows.

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.9/5.0
Behavior3/5

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

With no annotations provided, the description carries the burden of disclosing behavior. It lists the core operations but doesn't explicitly state whether the tool is read-only, what it returns, or any side effects. The 'never hand sums' tip is useful but doesn't address the tool's runtime or data handling behavior, leaving some behavioral aspects implicit.

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 two sentences, front-loaded with the call-to-action and differentiator, then the core capability, then a specific usage tip. No wasted words; 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?

Although the tool has 9 parameters, nested objects, and no output schema, the description covers the high-level purpose and a key usage tip. The schema provides parameter details, but the description lacks explicit information about return formats, default behaviors beyond what's in schema, or edge cases. For a tool of this complexity, it's adequate but not exhaustive.

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 already have descriptive text. The description adds context that aggregate/group_by are for totals, reinforcing the schema examples, but doesn't introduce new meaning beyond what the schema already documents. With high coverage, baseline 3 is appropriate.

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 clearly states the tool's purpose: it queries spreadsheet or CSV files with filter, group, aggregate, and sort operations. It distinguishes itself from built-in file readers and from siblings like sheet_read (which does not aggregate) by emphasizing its combined capabilities, making tool selection unambiguous.

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 directs users to call this tool for any spreadsheet or CSV path, and explicitly instructs to use aggregate/group_by here instead of hand-summing over sheet_read rows. This gives clear context and a specific exclusion, though it doesn't mention other alternatives like sheet_stats or sheet_find.

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

Deploy Server

Other Tools