Skip to main content
Glama

search_records

Read-onlyIdempotent

Search records for a resource_id; search_type decides how the query is matched and defaults to hybrid. Use it when the request is in the user's own words; when the selection is an exact field condition, query_records filters without ranking. 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 choose among hits and then fetch one. 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
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.
queryYesThe text to search for. Whether it is matched by keyword, by meaning, or by both is decided by `search_type`.
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.
search_typeNoHow `query` is matched. `hybrid` (the default) ranks a union of keyword and meaning matches and is the right choice when in doubt. `text` matches keywords only — use it for identifiers, codes, names and exact phrases. `semantic` matches meaning only, so it can return records that share no word with the query, and it returns nothing at all on a collection with no embeddings. `vector_boosted` keeps `text`'s guarantee that every result really contains the query terms and only reorders them, lifting the closest few by meaning to the top; the rest keep the collection's default order and report `_sys.relevance` 0.hybrid

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageYes
itemsYesThe matching records, ranked, at most `limit` of them.
truncationNoPresent when a text limit is in force for this collection.
execution_infoNoWhich search mode actually ran, which can differ from `search_type` when a mode is unavailable.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "execution_info": {
      +      "description": "Which search mode actually ran, which can differ from `search_type` when a mode is unavailable.",
      +      "properties": {
      +        "applied_search_type": {
      +          "type": "string"
      +        },
      +        "search_mode": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "items": {
      +      "description": "The matching records, ranked, 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. Changed1 schema field 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."
  3. Changed1 schema field 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."
  4. 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."
    • 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."
  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. Changed5 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."
    • addedInput schema / properties / query / description
      Added value: +"The text to search for. Whether it is matched by keyword, by meaning, or by both is decided by `search_type`."
    • addedInput schema / properties / search_type / default
      Added value: +"hybrid"
    • addedInput schema / properties / search_type / description
      Added value: +"How `query` is matched. `hybrid` (the default) ranks a union of keyword and meaning matches and is the right choice when in doubt. `text` matches keywords only — use it for identifiers, codes, names and exact phrases. `semantic` matches meaning only, so it can return records that share no word with the query, and it returns nothing at all on a collection with no embeddings. `vector_boosted` keeps `text`'s guarantee that every result really contains the query terms and only reorders them, lifting the closest few by meaning to the top; the rest keep the collection's default order and report `_sys.relevance` 0."
  8. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context beyond that: long text fields may be shortened with `_sys.truncated`, results default to 5, every page is re-sent on later turns, and vector_boosted reports `_sys.relevance` 0 for non-boosted results. This is rich, non-obvious behavior that an agent could not infer from annotations or schema alone.

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 dense but well-organized, with the core purpose and sibling differentiation front-loaded. Every sentence earns its place, and the cost-model guidance is valuable. It is longer than strictly necessary, but the length is justified by the tool's complexity (9 parameters, 4 search types, pagination, truncation, population). A slightly tighter structure would earn 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?

Given the tool's complexity, the description covers all the critical operational aspects: when to use it, how search_type behaves, truncation, pagination costs, limit guidance, and the relationship to get_record. The output schema exists, so return values don't need to be spelled out. The only minor gap is that it doesn't explicitly mention the `filters` parameter's interaction with ranking, but the schema covers filters well and the description's focus on search_type is sufficient.

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 description adds meaning beyond the schema for several parameters: it explains the cost model behind limit and cursor, clarifies that populate avoids per-record resolution costs, and gives nuanced guidance on search_type (e.g., semantic returns nothing on collections without embeddings, vector_boosted preserves text's guarantee). It doesn't add much for resource_id or parents, but the schema already covers those adequately.

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 specific verb and resource ('Search records for a resource_id') and immediately distinguishes itself from query_records by naming the sibling and the exact condition that selects it ('when the selection is an exact field condition, query_records filters without ranking'). It also explains the search_type semantics, so an agent can tell this tool apart from its siblings without opening the 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?

The description gives explicit when-to-use guidance: use it when the request is in the user's own words, and use query_records for exact field conditions. It also provides concrete operational guidance: raise limit for enumeration/counting, use get_record for full documents, and prefer populate over resolving references. This is exactly the kind of routing and decision support an agent needs.

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