Skip to main content
Glama

query_records

Read-onlyIdempotent

List records by filters/sort/cursor for a resource_id. Use it when the selection is expressible as field conditions; when the request is in the user's own words, search_records ranks by meaning instead. Long text fields may be shortened in results; a shortened record carries _sys.truncated. Where the resource lists get_one among its discover_resources capabilities, call get_record with that record's id for the full document. Returns 5 records unless limit says otherwise — enough to find a document and then fetch it. When the task is to enumerate or count, raise limit (up to 100) instead of paging through small pages: every page is resent on every later turn, so many small pages cost far more than one large one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoField names to order by, most significant first. Prefix a name with `-` for descending, so `-_sys.created_at` is newest first. `_sys` fields are sortable as well as schema fields; describe_resource lists the schema ones.
limitNoRecords per call. Defaults to 5, which is enough to pick a hit and fetch it in full with get_record. Raise it (up to 100) when the task is to enumerate or count rather than to find.
cursorNoPass back `page.next_cursor` from a previous response to get the following page. Reach for it only when a page really has to be continued: raising `limit` costs one call where paging costs one per page, and every page already fetched is re-sent on every later turn.
filtersNoField conditions, all of which must hold. `field` is a field path from the collection's describe_resource schema, `op` defaults to `eq`, and `value` follows the operator: a list for `in`/`not_in`, a two-element list for `between`, a single value otherwise.
localesNoLocale codes (`en`, `fr`, ...) to keep in localized fields. Omit it to get every locale the record carries, which is the right default unless one language was asked for. The codes are the keys of a localized field in any record of this collection; a code the environment does not use is not an error, it simply matches nothing.
parentsNoParent placeholders for nested resource_id templates.
populateNoReference and relation fields come back as opaque record keys. Name those fields here and the records they point at are fetched and grafted in place of the key. Prefer it whenever a list result carries references the task needs: resolving them afterwards costs one call per record, and every earlier result is re-sent on every later turn, so ten resolved by hand cost far more than one populated call. Populated records obey the same text limit as the rest of this response; call get_record on a key for the unshortened record.
resource_idYesResource identifier from discover_resources.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageYes
itemsYesThe matching records, at most `limit` of them.
truncationNoPresent when a text limit is in force for this collection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "items": {
      +      "description": "The matching records, at most `limit` of them.",
      +      "items": {
      +        "properties": {
      +          "_sys": {
      +            "properties": {
      +              "created_at": {
      +                "format": "date-time",
      +                "type": "string"
      +              },
      +              "folder": {
      +                "type": "string"
      +              },
      +              "key": {
      +                "type": "string"
      +              },
      +              "relevance": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "revision": {
      +                "type": "string"
      +              },
      +              "truncated": {
      +                "description": "Present only when this record had text shortened. One entry per field that was cut.",
      +                "items": {
      +                  "properties": {
      +                    "field": {
      +                      "description": "Path to the shortened field, `author.bio` for one reached through populate.",
      +                      "type": "string"
      +                    },
      +                    "locale": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    },
      +                    "original_length": {
      +                      "type": "integer"
      +                    }
      +                  },
      +                  "required": [
      +                    "field",
      +                    "original_length"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              },
      +              "updated_at": {
      +                "format": "date-time",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "key"
      +            ],
      +            "type": "object"
      +          },
      +          "data": {
      +            "additionalProperties": true,
      +            "description": "The record itself, shaped by the collection schema that describe_resource returns.",
      +            "type": "object"
      +          },
      +          "id": {
      +            "description": "Document key. Pass it to get_record as `record_id`.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "data",
      +          "_sys"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "page": {
      +      "properties": {
      +        "has_more": {
      +          "type": "boolean"
      +        },
      +        "limit": {
      +          "type": "integer"
      +        },
      +        "next_cursor": {
      +          "description": "Pass back as `cursor` to continue. Null when there is no further page.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "previous_cursor": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "returned": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "has_more",
      +        "returned",
      +        "limit"
      +      ],
      +      "type": "object"
      +    },
      +    "truncation": {
      +      "description": "Present when a text limit is in force for this collection.",
      +      "properties": {
      +        "applied": {
      +          "type": "boolean"
      +        },
      +        "max_text_chars": {
      +          "type": "integer"
      +        },
      +        "note": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "items",
      +    "page"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / cursor / description
      Added value: +"Pass back `page.next_cursor` from a previous response to get the following page. Reach for it only when a page really has to be continued: raising `limit` costs one call where paging costs one per page, and every page already fetched is re-sent on every later turn."
    • addedInput schema / properties / sort / description
      Added value: +"Field names to order by, most significant first. Prefix a name with `-` for descending, so `-_sys.created_at` is newest first. `_sys` fields are sortable as well as schema fields; describe_resource lists the schema ones."
  3. Changed2 schema fields changed
    • removedInput schema / properties / cursor / description
      Removed value: -"Pass back `page.next_cursor` from a previous response to get the following page. Reach for it only when a page really has to be continued: raising `limit` costs one call where paging costs one per page, and every page already fetched is re-sent on every later turn."
    • removedInput schema / properties / sort / description
      Removed value: -"Field names to order by, most significant first. Prefix a name with `-` for descending, so `-_sys.created_at` is newest first. `_sys` fields are sortable as well as schema fields; describe_resource lists the schema ones."
  4. Changed3 schema fields changed
    • addedInput schema / properties / cursor / description
      Added value: +"Pass back `page.next_cursor` from a previous response to get the following page. Reach for it only when a page really has to be continued: raising `limit` costs one call where paging costs one per page, and every page already fetched is re-sent on every later turn."
    • changedInput schema / properties / populate / description
      Previous value: -"Reference and relation fields come back as opaque record keys. Name those fields here and the records they point at are fetched and grafted in place of the key, which costs one call instead of two. Populated records obey the same text limit as the rest of this response; call get_record on a key for the unshortened record."New value: +"Reference and relation fields come back as opaque record keys. Name those fields here and the records they point at are fetched and grafted in place of the key. Prefer it whenever a list result carries references the task needs: resolving them afterwards costs one call per record, and every earlier result is re-sent on every later turn, so ten resolved by hand cost far more than one populated call. Populated records obey the same text limit as the rest of this response; call get_record on a key for the unshortened record."
    • addedInput schema / properties / sort / description
      Added value: +"Field names to order by, most significant first. Prefix a name with `-` for descending, so `-_sys.created_at` is newest first. `_sys` fields are sortable as well as schema fields; describe_resource lists the schema ones."
  5. Changed1 schema field changed
    • changedInput schema / properties / populate / description
      Previous value: -"Reference and relation fields come back as opaque record keys. Name those fields here and the records they point at are fetched and grafted in place of the key, which costs one call instead of two. Populated records are never shortened, whatever the text limit is."New value: +"Reference and relation fields come back as opaque record keys. Name those fields here and the records they point at are fetched and grafted in place of the key, which costs one call instead of two. Populated records obey the same text limit as the rest of this response; call get_record on a key for the unshortened record."
  6. Changed1 schema field changed
    • addedInput schema / properties / populate / description
      Added value: +"Reference and relation fields come back as opaque record keys. Name those fields here and the records they point at are fetched and grafted in place of the key, which costs one call instead of two. Populated records are never shortened, whatever the text limit is."
  7. Changed2 schema fields changed
    • addedInput schema / properties / filters / description
      Added value: +"Field conditions, all of which must hold. `field` is a field path from the collection's describe_resource schema, `op` defaults to `eq`, and `value` follows the operator: a list for `in`/`not_in`, a two-element list for `between`, a single value otherwise."
    • addedInput schema / properties / locales / description
      Added value: +"Locale codes (`en`, `fr`, ...) to keep in localized fields. Omit it to get every locale the record carries, which is the right default unless one language was asked for. The codes are the keys of a localized field in any record of this collection; a code the environment does not use is not an error, it simply matches nothing."
  8. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds valuable behavior beyond that: long text fields may be truncated with a `_sys.truncated` flag, and it explains the cost model where every page is re-sent on later turns. It does not cover all possible edge cases (e.g., empty results), but it is substantially transparent.

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 description is long but every sentence serves a purpose. It front-loads the core purpose, then usage guidance, then behavioral and performance notes. It is dense and well-organized, not verbose, though slightly longer than strictly necessary.

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 tool with 8 parameters, nested objects, and several sibling tools, this description is exceptionally complete. It covers selection criteria, result truncation, paging costs, reference population, and the relationship to get_record and search_records. With an output schema present, nothing essential is missing.

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. The main description adds strategic guidance on `limit` (raise for enumeration) and `cursor` (avoid paging because of re-send costs), supplementing the already detailed schema descriptions. This adds meaning beyond the schema, though not for every parameter individually.

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 opens with a precise verb+resource: 'List records by filters/sort/cursor for a resource_id.' It also distinguishes itself from sibling tools, explicitly noting search_records for natural-language queries and get_record for full documents, so an agent can immediately tell when this tool is the right choice.

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?

It provides explicit when-to-use guidance: use when selection is expressible as field conditions, and use search_records when the request is in the user's own words. It also directs toward get_record for full documents and advises raising `limit` for enumeration/counting rather than paging. This is clear routing with no ambiguity.

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.

Resources