Skip to main content
Glama

query_sheet

Filter and retrieve specific Excel sheet rows using pandas expressions, returning only selected columns and limited rows to reduce LLM context usage.

Instructions

Query sheet data using pandas expressions without returning the entire sheet into the LLM context.

Args: path: Path to the .xlsx file, or the name of a preloaded file. Omit if only one file is configured. sheet: Sheet name. filter_query: Pandas query expression (e.g. "status == 'PAID' and amount > 500"). columns: Optional list of columns to return. max_rows: Maximum rows to return (default 100). cell_range: Optional range to restrict reading before querying.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
sheetYes
columnsNo
max_rowsNo
cell_rangeNo
filter_queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses a behavioral trait beyond the schema (it avoids loading the whole sheet into context) and states the max_rows default, but it says nothing about read-only safety, behavior on invalid pandas expressions, or error handling for missing sheets/files.

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?

The purpose sentence is front-loaded before the Args list, and the parameter list is compact with no filler. Slightly docstring-conventional but every line carries information.

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 6-parameter query tool with an output schema (so return values need not be described) and no annotations, the description covers purpose, token-efficiency rationale, and all parameters. The main gap is the absence of any safety/permission or failure-mode context, which the missing annotations leave unaddressed.

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 description coverage is 0%, so the description must compensate, and it does: the Args block documents all six parameters, gives a concrete filter_query example ('status == ''PAID'' and amount > 500'), and clarifies path can be a preloaded file name and cell_range restricts reading before querying. This meaningfully exceeds the bare schema.

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 gives a specific verb (Query) and resource (sheet data) plus the mechanism (pandas expressions), and the phrase 'without returning the entire sheet into the LLM context' implicitly distinguishes it from read_sheet. It does not name the relevant siblings explicitly, but an agent can tell it is the filtered/expression-based read path rather than a bulk read.

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?

Usage is only implied: the token-efficiency framing suggests it is preferred over read_sheet for large sheets, but there is no explicit when-to-use/when-not-to-use statement or named alternative. An agent must infer the trade-off against read_sheet and aggregate_sheet.

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