Skip to main content
Glama

Query CRM records

crm_query
Read-onlyIdempotent

Finds what is stored on one list in the business CRM. model is the list name, such as Contacts. A filter is a detail they named, such as a person's name. A plain sentence is enough, such as change Sara's phone number. Use this before you say someone is missing or gone. search_contacts is the phone address book, not this CRM. A filter value matches that field. A filter object uses eq, ne, gt, gte, lt, lte, in, or contains. sort is a field name, {field, direction}, or a list of those. direction is asc or desc. sort_by is one field and sort_dir is asc or desc for this read only. It does not need a saved view and it is not stored. Ask for a count when you only need how many match. It does not change what is stored. Opening hours, addresses, and prices are in get_account.business_facts.

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": {
      "model": "<model>"
    },
    "name": "crm_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoA field name, {field, direction}, or a list of those. direction is asc or desc.
limitNoPage size. Omitted means 50, and larger values are capped there.
modelYesList name on this account.
offsetNoHow many matching records to skip. Defaults to 0.
filtersNoField name to a value, which means equals. Or {op, value}, or {eq, ne, gt, gte, lt, lte, in, contains} to a value. in takes a list.
includeNoRef field names to expand with the related record.
sort_byNoOne field for this read. It does not need a saved view and it is not stored.
group_byNoField names. Returns a count for each combination instead of records. Ignored when count_only is true.
sort_dirNoasc or desc for sort_by. Defaults to asc. A later read with no sort_by is unordered by this.
directionNoasc or desc when sort is a field name or a list of field names. Defaults to asc.
count_onlyNoWhen true, return how many records match and no rows.
include_deletedNoInclude soft-deleted records.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / sort_by
      Added value: +{
      +  "description": "One field for this read. It does not need a saved view and it is not stored.",
      +  "type": "string"
      +}
    • addedInput schema / properties / sort_dir
      Added value: +{
      +  "description": "asc or desc for sort_by. Defaults to asc. A later read with no sort_by is unordered by this.",
      +  "enum": [
      +    "asc",
      +    "desc"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so several statements ("It does not change what is stored") merely restate them. It does add genuine context beyond the annotations: sort configuration is not persisted across reads, no saved view is needed, and business facts live in another tool. Pagination behavior and soft-delete semantics are left entirely to the schema.

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

Conciseness2/5

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

The description is a run of short, loosely connected sentences with heavy repetition: filter semantics are explained twice, and sort/direction semantics are restated verbatim from the schema. Only the first two sentences are truly front-loaded; routing and schema-echo content is interleaved with no structure or grouping.

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?

For a 12-parameter tool with nested objects and no output schema, the description covers the core read behavior, count mode, and sibling routing. However, it says nothing about pagination defaults, result shape, or the expansion behavior of `include`, which an agent must infer from the schema alone.

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 baseline is 3, and the description largely paraphrases what the schema already says (filter operators, sort formats, asc/desc). The only real additions are the illustrative examples ("such as Contacts", "such as a person's name"). `limit`, `offset`, `include`, `group_by`, and `include_deleted` are not discussed in the description at all.

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?

The opening states a specific verb and resource ("Finds what is stored on one list in the business CRM") and clarifies that `model` is the list name. It also explicitly separates itself from `search_contacts` ("the phone address book, not this CRM") and from `get_account.business_facts`. The phrasing is a bit informal, but an agent can identify the tool's job and its nearest lookalike.

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

Usage Guidelines4/5

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

Gives concrete usage cues: "Use this before you say someone is missing or gone" and "Ask for a count when you only need how many match." It also draws a negative boundary against `search_contacts` and notes that no saved view is required, implicitly contrasting with the saved-view siblings. It stops short of naming `crm_run_view` or `crm_list_models` as explicit alternatives for those cases.

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.