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
    • 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."
  2. 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"
      +}
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the read-only annotations, the description discloses detailed aggregation behavior: how data.<Key> values are interpreted, how dates bucket, how multiple measures are keyed in the response, how groups are ordered, and that at most 100 groups are returned. These are exactly the behavioral traits an agent needs to call and interpret the tool correctly.

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 front-loaded and nearly every sentence carries semantic value. Some run-on constructions, especially around measures and data keys, reduce scanability slightly, but there is little wasted wording.

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 10-parameter aggregation tool with no output schema, the description is notably complete: it covers resource scope, filters, measures, grouping, date bucketing, output keying, ordering, and limits. Remaining ambiguity is minor and largely resolved by the rich input schema.

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?

The description adds substantial meaning beyond the already high schema coverage: it explains column choice and date exceptions, measures syntax including alternate-column syntax, group_by formats such as week/month/quarter/year prefixes and two-element lists, and the 100-group cap. This clarifies cross-parameter behavior that the schema alone does not fully capture.

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 states a specific verb family (count, sum, average, min, max) and resource scope (one resource's records, optionally grouped) in the first sentence. It explicitly contrasts with search_records by saying it takes the same query and filters, so an agent can distinguish aggregation from record retrieval.

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?

It clearly implies this is the aggregation tool when querying records, and points to describe_resources for valid columns and list_connections for connection selection. It does not explicitly say when to prefer this over search_records or when aggregation is inappropriate, but the context is strong.

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