Skip to main content
Glama

query_records

Fetch records from any Gadget model using filtering, sorting, pagination cursors, and field selection. Inspect filters first to build valid queries.

Instructions

Query records from any Gadget model. Supports filtering, sorting, pagination cursors, and field selection (all scalar fields by default). Use introspect_filters to see valid filter shapes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoSort value — array of sort objects, e.g. [{ createdAt: { sortOrder: "Descending" } }]
afterNoPagination cursor — pass the endCursor from a previous response to fetch the next page
limitNoMax records to return (default 10, max 50)
modelYesModel name in singular camelCase, e.g. shopifyOrder, label
fieldsNoGraphQL field selection, e.g. "id name email createdAt". Omit or use "*" for every scalar field; mix with relations like "* customer { email }".
filterNoFilter value — use introspect_filters to discover valid filter fields and shapes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.4.0
    • changedInput schema / properties / fields / description
      Previous value: -"GraphQL field selection, e.g. \"id name email createdAt\""New value: +"GraphQL field selection, e.g. \"id name email createdAt\". Omit or use \"*\" for every scalar field; mix with relations like \"* customer { email }\"."
    • changedInput schema / required
      Previous value: -[
      -  "model",
      -  "fields"
      -]New value: +[
      +  "model"
      +]
  2. Changed5 schema fields changedv1.0.1
    • addedInput schema / properties / after
      Added value: +{
      +  "description": "Pagination cursor — pass the endCursor from a previous response to fetch the next page",
      +  "type": "string"
      +}
    • changedInput schema / properties / filter / description
      Previous value: -"Gadget filter object, e.g. { \"name\": { \"equals\": \"#59389\" } }"New value: +"Filter value — use introspect_filters to discover valid filter fields and shapes."
    • removedInput schema / properties / filter / type
      Removed value: -"object"
    • changedInput schema / properties / model / description
      Previous value: -"Model name in camelCase, e.g. shopifyOrder, label"New value: +"Model name in singular camelCase, e.g. shopifyOrder, label"
    • addedInput schema / properties / sort
      Added value: +{
      +  "description": "Sort value — array of sort objects, e.g. [{ createdAt: { sortOrder: \"Descending\" } }]"
      +}
  3. First observedv1.0.6

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It discloses two useful defaults (all scalar fields returned when fields is omitted, cursor-based pagination) but says nothing about read-only safety, authorization requirements, result shape, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no filler, and the capability scope is front-loaded before the cross-tool pointer. Every clause earns its place.

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

Completeness3/5

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

Adequate for a read/query tool: capabilities, default field behavior, and the filter-discovery path are all covered, and the schema is fully documented. But with no output schema and no annotations, the description could have said more about the returned result shape and when not to use this tool.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents every parameter with examples (sort object shape, endCursor usage, limit default/max, GraphQL field selection syntax). The description only restates the capability list and adds the introspect_filters pointer, so baseline 3 applies.

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?

States a specific verb and resource ("Query records from any Gadget model") and enumerates the supported capabilities: filtering, sorting, pagination cursors, field selection. It does not differentiate itself from siblings like get_record, count_records, or run_graphql, so the agent must infer scope from names alone.

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?

One explicit routing hint is given — "Use introspect_filters to see valid filter shapes" — which is genuinely useful. However, there is no guidance on when to prefer this over get_record (single record), count_records, export_records, or run_graphql, so usage is only partially implied.

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