Skip to main content
Glama

Query Rows

query-rows
Read-onlyIdempotent

Filter, sort and count the ROWS of ONE table project (type: "table" in search-projects / get-project) by their column values — exact, structured queries that search-memo cannot do, e.g. "leads with status new and amount over 1000, newest first" or "deal amount per month". Read the columns and their descriptions with get-project first. where combines conditions with mode "and" / "or", and an entry can itself be a group of conditions — enough for "A and (B or C)". Operators: text — = != (case-insensitive) contains in empty not_empty; number and datetime — = != > >= < <= in empty not_empty; select — = != in empty not_empty; multiselect — = (has the option), != (lacks it), in (has any of them), empty, not_empty; checkbox — =. Datetime values are ISO 8601 (2026-10-13T14:30:00Z; a bare 2026-10-13 means its 00:00 UTC — use >= and < for a day or a range). Without aggregate it returns { columns, rows, total }: each row is { id, title, fields, tags, created_at, updated_at }, total counts every row under the filter. Page with limit / skip; read or edit a row by its id with get-memos / update-project-memo. With aggregate it returns { columns, groups, total } instead — counts, sums, averages, minimums and maximums over every row under the filter, optionally per value of up to two group_by columns (a datetime column groups by step: day, week, month or year, in timezone). A multiselect row counts once per option it has. Use it for any "how many / how much" question rather than paging through rows.

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": {
      "project_id": "<project_id>"
    },
    "name": "query-rows"
  }
}

Input Schema

NameRequiredDescriptionDefault
skipNoRows to skip for pagination
sortNoRow order, up to 3 columns. Default: newest first.
tagsNoTag ids (from search-tag) — only rows carrying ALL of them
limitNoRows per page (1-90)
whereNoThe filter (max 20 conditions in all). Omit for every row.
columnsNoReturn only these columns in each row's `fields`. Omit for all.
archivedNotrue to query ONLY archived (deleted) rows
group_byNoWith `aggregate`: one group per value of these columns (up to 2). Omit for a single total over all rows.
timezoneNoIANA timezone for grouping dates by step, e.g. Europe/Berlin. Default UTC.
aggregateNoCompute these over the rows instead of returning them, e.g. [{ fn: "count" }, { fn: "sum", column: "Amount" }]. Results are keyed "count", "sum_Amount", …; up to 100 groups.
project_idYesId of the table project (from search-projects). Required: one table per call.
exclude_tagsNoTag ids (from search-tag) — rows carrying ANY of them are left out

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description adds a great deal: the exact return shapes with and without `aggregate`, that `total` counts every row under the filter, pagination via limit/skip, multiselect rows counting once per option, and per-column-type operator applicability. This is well beyond what structured fields convey.

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?

Front-loaded with purpose before operators, aggregation and return shapes, and virtually every sentence carries new information. It is a dense, single-block paragraph rather than scannable sections, which costs some readability for a description this long.

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

Completeness5/5

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

No output schema exists, but the description fully specifies both return envelopes ({ columns, rows, total } and { columns, groups, total }), row field structure, pagination, aggregation keying and group limits. For a 12-parameter tool with nested `where`/`aggregate`/`group_by` objects, nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description adds meaning the schema does not: which operators apply to text, number, datetime, select, multiselect and checkbox columns, that a condition may itself be a nested group enabling "A and (B or C)", and the ISO 8601 convention including that a bare date means 00:00 UTC and day ranges should use >= and <.

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?

States specific verbs (filter, sort, count) against a precise resource (rows of ONE table project) and immediately contrasts with search-memo, which cannot do exact structured queries. An agent can distinguish it from search-memo, get-memos and search-projects without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: read columns via get-project first, use get-memos/update-project-memo to read or edit a single row by id, and use this tool "for any 'how many / how much' question rather than paging through rows." Both when-to-use and when-to-use-something-else are named.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.