Skip to main content
Glama

Summarize records

summarize_records
Read-only

Count, sum, average, min or max over one resource's records in one call, of any source, optionally per group. Takes the same query and filters as search_records. column is a number column from describe_resources (min and max also take a date), or data. for a top-level key of the record's document: a number there sums, a YYYY-MM-DD date buckets, anything else counts for nothing. measures asks several figures at once, e.g. ["count", "sum", "avg"] over column, or "sum:" for another column; the answer is then values, keyed as asked. group_by is a column, week:/month:/quarter:/year:<date column or data.>, or a list of two, e.g. ["", "month:"]. A week is named by its Monday. Groups come largest first, or in date order when a date is bucketed, at most 100.

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": {
      "resource": "<resource>"
    },
    "name": "summarize_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoGroups to answer. Default and most 100.
queryNo
columnNoWhat to sum, average, min or max: a column describe_resources lists.
filtersNoColumn filters, from the columns describe_resources lists for the resource: {"<column>": "value"}, {"<column>": ["one", "another"]}, {"<column>": {"contains": "acme"}}, {"<date column>": {"gte": "2026-04-01", "lte": "2026-06-30"}}, or "data.<Key>" for a top-level key of the record's document. Operators: eq, ne, in, not_in, gte, lte, contains, null.
measureNoDefault count.
group_byNoe.g. <column>, month:<date column>, or ["<column>", "quarter:<date column>"].
measuresNoSeveral figures in one call, in place of measure.
resourceYesA resource key from describe_resources, e.g. invoices.
connection_idNoOmit when only one of the company's sources holds the resource; list_connections names them.
modified_sinceNoISO 8601 time; only records the source changed since then.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / filters / properties
      Added value: +{}
  2. Changed1 schema field changed
    • changedInput schema / properties / filters / description
      Previous value: -"Column filters, from the columns describe_resources lists for the resource: {\"<column>\": \"value\"}, {\"<column>\": [\"one\", \"another\"]}, {\"<column>\": {\"contains\": \"acme\"}}, {\"<date column>\": {\"gte\": \"2026-04-01\", \"lte\": \"2026-06-30\"}}. Operators: eq, ne, in, not_in, gte, lte, contains, null."New value: +"Column filters, from the columns describe_resources lists for the resource: {\"<column>\": \"value\"}, {\"<column>\": [\"one\", \"another\"]}, {\"<column>\": {\"contains\": \"acme\"}}, {\"<date column>\": {\"gte\": \"2026-04-01\", \"lte\": \"2026-06-30\"}}, or \"data.<Key>\" for a top-level key of the record's document. Operators: eq, ne, in, not_in, gte, lte, contains, null."
  3. Changed2 schema fields changed
    • removedInput schema / properties / build_id
      Removed value: -{
      -  "description": "Omit when only one of the company's builds holds the resource; list_connections names them.",
      -  "type": "integer"
      -}
    • addedInput schema / properties / connection_id
      Added value: +{
      +  "description": "Omit when only one of the company's sources holds the resource; list_connections names them.",
      +  "type": "integer"
      +}
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the read-only, non-destructive profile, and the description adds real behavioral context beyond them: result ordering ('Groups come largest first, or in date order when a date is bucketed'), the hard cap of 100 groups, how weeks are labeled, and the fact that a non-numeric, non-date document key 'counts for nothing' rather than erroring. It does not discuss cost, latency, or failure modes for invalid columns, which keeps it below a 5.

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?

It is front-loaded with the operation and scope, then proceeds parameter by parameter with no filler sentence. The trade-off is density: several clauses are long and comma-chained, which makes it harder to scan, though nothing is redundant.

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

Completeness4/5

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

For a 10-parameter tool with no output schema, the description covers the important unknowns: how the result is shaped ('the answer is then values, keyed as asked'), group ordering and the 100-group ceiling, and the type-dependent behavior of document keys. Left implicit are error behavior for invalid columns and the interaction between limit and group caps, which are minor given the schema descriptions.

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

Parameters5/5

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

Schema coverage is already 90%, yet the description still adds meaning the schema cannot express: what data.<Key> does depending on the value's type (number sums, YYYY-MM-DD buckets, anything else counts nothing), the 'sum:<column>' alternate-column syntax for measures, the week:/month:/quarter:/year: prefixes for group_by, and the two-element list form. These are non-obvious semantics that materially reduce wrong invocations.

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 opening clause names a concrete operation ('Count, sum, average, min or max over one resource's records in one call') plus its scope ('optionally per group'), which is far more specific than the title. It also situates itself against the sibling search_records by sharing its query and filters, so an agent can tell aggregation apart from listing without opening either schema.

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?

The line 'Takes the same query and filters as search_records' gives an agent a clear decision rule: same inputs, aggregate instead of enumerate. It stops short of explicit when-not-to-use guidance (e.g. when a grouped aggregate is cheaper than paging search results, or when raw records are needed), so the routing is clear but not exhaustively stated.

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