Skip to main content
Glama

List records with pagination, or count them

record_query
Read-only

List records with pagination, or count them

Always keyset-paginated: when nextCursor comes back non-null there ARE more records — page with it instead of raising limit (capped at 100). Pass countOnly to get the total without fetching rows — it is a real, exact SQL count (never an estimate), so it is the right tool for a dashboard total instead of paging through everything and counting client-side. countOnly accepts viewId and/or filters to count a scoped subset (e.g. "PRs on the main branch"); both require baseId. To find records by a field value use record_find_by_field; to search content use search or grep. A record page is { records, nextCursor }. nextCursor only means another page exists; pass it back as cursor and do not treat it as data. Each record's current business values live only in records[].headCommit.payload, keyed by field slug. Read that object. records and nextCursor are the page wrapper, not fields. Commit metadata (headCommit.id, author, message) and hydrated parents (base, createdByUser) are not field values. If a slug is absent from payload, the field is empty — do not invent it from the wrapper or from a sibling key.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "record_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoOne-field sort, e.g. {"fieldSlug":"due","direction":"asc"}. Number and date fields sort on the server; other types come back in the default order. Needs baseId unless you pass fieldType; an unknown field is an error.
limitNoPage size, 1-100 (default 50).
baseIdNoRestrict to one Base. Omit for the space.
cursorNoOpaque cursor from the previous page.
viewIdNocountOnly only: count the rows this saved View displays. Requires baseId. Listing a View's rows is records.listPage (`busabase-cli records list-page`); passing viewId without countOnly is an error.
filtersNoView filters pushed down to the server. With countOnly, requires baseId; not every filter is a cheap SQL count (see the records.count API description) but the result is always exact.
playbookNoOptional. The playbook you are following, as `kind:nodeId[:key]` from playbooks_search (e.g. `prompt:nod_123:log-visit`). Recorded on the change request so the person can see which playbook produced it.
countOnlyNoReturn the total instead of rows.
targetSpaceIdNoBusabase space id. Call auth_verify first and ask the user which space to use when more than one is returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / sort / description
      Previous value: -"View sort (number/date fields only)."New value: +"One-field sort, e.g. {\"fieldSlug\":\"due\",\"direction\":\"asc\"}. Number and date fields sort on the server; other types come back in the default order. Needs baseId unless you pass fieldType; an unknown field is an error."
    • changedInput schema / properties / viewId / description
      Previous value: -"countOnly only: count the rows this saved View displays. Requires baseId."New value: +"countOnly only: count the rows this saved View displays. Requires baseId. Listing a View's rows is records.listPage (`busabase-cli records list-page`); passing viewId without countOnly is an error."
  2. Changed1 schema field changed
    • addedInput schema / properties / playbook
      Added value: +{
      +  "description": "Optional. The playbook you are following, as `kind:nodeId[:key]` from playbooks_search (e.g. `prompt:nod_123:log-visit`). Recorded on the change request so the person can see which playbook produced it.",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile, but the description adds substantial behavior beyond them: keyset pagination semantics, a hard limit cap of 100, countOnly being an exact SQL count rather than an estimate, and the page wrapper shape { records, nextCursor }. It also warns that nextCursor is not data and that business values live only in records[].headCommit.payload, which prevents real misreads.

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 the core purpose and pagination rule, then routing guidance, then return-shape caveats; nearly every sentence carries a distinct instruction. It is dense and repeats the limit cap already present in the schema, which keeps it just short of a 5.

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?

For a 9-parameter read tool with no output schema, the description supplies the missing return contract (records/nextCursor wrapper, payload location, absent slug means empty) and the paging protocol. Nothing needed to call it correctly is left implicit.

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 coverage is 100%, so the baseline is 3, but the description adds cross-parameter meaning: countOnly accepts viewId and/or filters to count a scoped subset and both require baseId, and cursor must be fed back from nextCursor. It supplies a concrete example ('PRs on the main branch') that clarifies the filter scope.

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 a specific verb and resource plus the dual mode ('List records with pagination, or count them'), and explicitly contrasts itself with record_find_by_field, search and grep. An agent can pick this tool over siblings 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?

Gives explicit when-to-use rules: use countOnly for an exact dashboard total instead of client-side counting, page with nextCursor rather than raising limit, and route field-value lookup to record_find_by_field and content search to search/grep. It also names the exclusion (viewId without countOnly is an error).

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.