Query sheet rows
query_sheetFilter a table-shaped Excel sheet by header-based conditions and return matching rows, selected columns, and row counts to extract focused subsets from large datasets.
Instructions
Return only the rows of a table-shaped sheet (first row = headers) that match a condition.
Returns {columns, records, row_count, limited}; row_count counts all matches. Use instead of read_sheet when you need a subset of a large table. For totals per group use aggregate_sheet.
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": {
"sheet": "<sheet>",
"filter_query": "<filter_query>"
},
"name": "query_sheet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | File path or preloaded name (list_configured_files). Omit if only one file is preloaded. | |
| sheet | Yes | Sheet name (case-sensitive). | |
| columns | No | Only return these columns. Omit for all. | |
| max_rows | No | Return at most this many matching rows. | |
| cell_range | No | Range to read, e.g. "A1:F500". Omit for the whole sheet. | |
| filter_query | Yes | Condition on header names, e.g. "Status == 'PAID' and Amount > 500". Allowed: comparisons, and/or/not, in, arithmetic. Header names must be valid identifiers (no spaces). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||