Skip to main content
Glama

Bankstatemently

Aggregate Transactions

aggregate
Read-only

Compute a single metric (sum/average/count/max/min) over a filtered set of transactions across your converted statements. Results are per-currency — never sum across currencies yourself. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range. For "how many credits do I have" / processing quota / remaining pages, use get_credits instead — that is not a transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoOptional structural scope (WHO × WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).
filterNoSubset of transactions to operate on. All fields are optional and combined with AND logic.
metricYesAggregation metric.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeYes
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedOutput schema / $defs
      Added value: +{
      +  "__schema0": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "number"
      +      },
      +      {
      +        "type": "boolean"
      +      },
      +      {
      +        "type": "null"
      +      },
      +      {
      +        "items": {
      +          "$ref": "#/$defs/__schema0"
      +        },
      +        "type": "array"
      +      },
      +      {
      +        "additionalProperties": {
      +          "$ref": "#/$defs/__schema0"
      +        },
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      }
      +    ]
      +  }
      +}
    • changedOutput schema / properties / result / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": {},
      -    "properties": {},
      -    "type": "object"
      -  },
      -  {
      -    "items": {
      -      "additionalProperties": {},
      -      "properties": {},
      -      "type": "object"
      -    },
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {
      +      "$ref": "#/$defs/__schema0"
      +    },
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "items": {
      +      "additionalProperties": {
      +        "$ref": "#/$defs/__schema0"
      +      },
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +]
    • changedOutput schema / properties / scope / additionalProperties
      Previous value: -{}New value: +false
  2. Changed21 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / filter / description
      Added value: +"Subset of transactions to operate on. All fields are optional and combined with AND logic."
    • addedInput schema / properties / filter / properties / accounts / description
      Added value: +"Account number slugs to include."
    • addedInput schema / properties / filter / properties / amountMax / description
      Added value: +"Inclusive maximum absolute amount."
    • addedInput schema / properties / filter / properties / amountMin / description
      Added value: +"Inclusive minimum absolute amount."
    • addedInput schema / properties / filter / properties / category / description
      Added value: +"Category slug, e.g. \"meals_entertainment\", \"groceries_personal\"."
    • addedInput schema / properties / filter / properties / currency / description
      Added value: +"ISO 4217 currency code. E.g. \"USD\", \"HKD\"."
    • addedInput schema / properties / filter / properties / dateEnd / description
      Added value: +"ISO date (YYYY-MM-DD). Inclusive upper bound."
    • addedInput schema / properties / filter / properties / dateStart / description
      Added value: +"ISO date (YYYY-MM-DD). Inclusive lower bound."
    • addedInput schema / properties / filter / properties / direction / description
      Added value: +"Semantic direction."
    • addedInput schema / properties / filter / properties / merchant / description
      Added value: +"Substring match against description or counterparty (case-insensitive)."
    • addedInput schema / properties / filter / properties / text / description
      Added value: +"Whole-row text search over raw transaction fields (case-insensitive)."
    • addedInput schema / properties / metric / description
      Added value: +"Aggregation metric."
    • addedInput schema / properties / scope / description
      Added value: +"Optional structural scope (WHO × WHEN). Omit to search across all your completed statements. \"accounts\" is a list of account/product chips (kind + identityKey); \"dateRange\" bounds by transaction date (YYYY-MM-DD)."
    • addedInput schema / properties / scope / properties / accounts / description
      Added value: +"Account/product chips (kind + identityKey) to scope to. Empty = all accounts."
    • removedInput schema / properties / scope / properties / accounts / items / anyOf
      Removed value: -[
      -  {
      -    "properties": {
      -      "anchorContentHash": {
      -        "type": "string"
      -      },
      -      "identityKey": {
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "account",
      -        "type": "string"
      -      },
      -      "label": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "identityKey"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "identityKey": {
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "product",
      -        "type": "string"
      -      },
      -      "label": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "identityKey"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / scope / properties / accounts / items / oneOf
      Added value: +[
      +  {
      +    "properties": {
      +      "anchorContentHash": {
      +        "description": "Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).",
      +        "type": "string"
      +      },
      +      "identityKey": {
      +        "description": "Canonical account identity key (accountIdentityKey), never a raw DB UUID.",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "account",
      +        "description": "This chip addresses a single account.",
      +        "type": "string"
      +      },
      +      "label": {
      +        "description": "Display label for this chip.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "identityKey"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "identityKey": {
      +        "description": "Product slug.",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "product",
      +        "description": "This chip addresses a product and expands to its child accounts.",
      +        "type": "string"
      +      },
      +      "label": {
      +        "description": "Display label for this chip.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "identityKey"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / scope / properties / dateRange / description
      Added value: +"Bounds results to transactions within this date range. Omit for no date filter."
    • addedInput schema / properties / scope / properties / dateRange / properties / from / description
      Added value: +"Start of the date range (inclusive), YYYY-MM-DD."
    • addedInput schema / properties / scope / properties / dateRange / properties / to / description
      Added value: +"End of the date range (inclusive), YYYY-MM-DD."
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Changed19 schema fields changed
    • removedInput schema / properties / filter / description
      Removed value: -"Subset of transactions to operate on. All fields are optional and combined with AND logic."
    • removedInput schema / properties / filter / properties / accounts / description
      Removed value: -"Account number slugs to include."
    • removedInput schema / properties / filter / properties / amountMax / description
      Removed value: -"Inclusive maximum absolute amount."
    • removedInput schema / properties / filter / properties / amountMin / description
      Removed value: -"Inclusive minimum absolute amount."
    • removedInput schema / properties / filter / properties / category / description
      Removed value: -"Category slug, e.g. \"meals_entertainment\", \"groceries_personal\"."
    • removedInput schema / properties / filter / properties / currency / description
      Removed value: -"ISO 4217 currency code. E.g. \"USD\", \"HKD\"."
    • removedInput schema / properties / filter / properties / dateEnd / description
      Removed value: -"ISO date (YYYY-MM-DD). Inclusive upper bound."
    • removedInput schema / properties / filter / properties / dateStart / description
      Removed value: -"ISO date (YYYY-MM-DD). Inclusive lower bound."
    • removedInput schema / properties / filter / properties / direction / description
      Removed value: -"Semantic direction."
    • removedInput schema / properties / filter / properties / merchant / description
      Removed value: -"Substring match against description or counterparty (case-insensitive)."
    • removedInput schema / properties / filter / properties / text / description
      Removed value: -"Whole-row text search over raw transaction fields (case-insensitive)."
    • removedInput schema / properties / metric / description
      Removed value: -"Aggregation metric."
    • removedInput schema / properties / scope / description
      Removed value: -"Optional structural scope (WHO × WHEN). Omit to search across all your completed statements. \"accounts\" is a list of account/product chips (kind + identityKey); \"dateRange\" bounds by transaction date (YYYY-MM-DD)."
    • removedInput schema / properties / scope / properties / accounts / description
      Removed value: -"Account/product chips (kind + identityKey) to scope to. Empty = all accounts."
    • addedInput schema / properties / scope / properties / accounts / items / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "anchorContentHash": {
      +        "type": "string"
      +      },
      +      "identityKey": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "account",
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "identityKey"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "identityKey": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "product",
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "identityKey"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / scope / properties / accounts / items / oneOf
      Removed value: -[
      -  {
      -    "properties": {
      -      "anchorContentHash": {
      -        "description": "Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).",
      -        "type": "string"
      -      },
      -      "identityKey": {
      -        "description": "Canonical account identity key (accountIdentityKey), never a raw DB UUID.",
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "account",
      -        "description": "This chip addresses a single account.",
      -        "type": "string"
      -      },
      -      "label": {
      -        "description": "Display label for this chip.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "identityKey"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "identityKey": {
      -        "description": "Product slug.",
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "product",
      -        "description": "This chip addresses a product and expands to its child accounts.",
      -        "type": "string"
      -      },
      -      "label": {
      -        "description": "Display label for this chip.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "identityKey"
      -    ],
      -    "type": "object"
      -  }
      -]
    • removedInput schema / properties / scope / properties / dateRange / description
      Removed value: -"Bounds results to transactions within this date range. Omit for no date filter."
    • removedInput schema / properties / scope / properties / dateRange / properties / from / description
      Removed value: -"Start of the date range (inclusive), YYYY-MM-DD."
    • removedInput schema / properties / scope / properties / dateRange / properties / to / description
      Removed value: -"End of the date range (inclusive), YYYY-MM-DD."
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With readOnlyHint and destructiveHint already set, the description adds the important behavioral caveat that results are per-currency and must never be summed manually, plus the default scope of all completed statements. That is genuinely useful behavioral disclosure beyond the annotations, and it does not contradict them.

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?

The description is compact and front-loaded: the first sentence states the core purpose and metric list, the second conveys the most critical behavioral rule, and the last handles an alternative. No sentence repeats schema content, and nothing is extraneous.

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 non-destructive aggregation tool with a fully described schema and an output schema, the description covers the needed context: default scope, filtering, the per-currency danger, and the correct sibling for a different class of question. The nested filter object and output shape are already documented in the schema, so nothing agent-critical is missing.

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, but the description adds semantic value: it clarifies the purpose of scope (narrowing by accounts/products and date range), calls attention to a 'filtered set', and warns about per-currency handling, which directly impacts use of metric. These additions are not purely redundant with the schema.

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 concrete verb and resource: "Compute a single metric ... over a filtered set of transactions across your converted statements." It lists the five possible metrics and clearly contrasts the tool with get_credits, while the phrase "single metric" distinguishes it from bucket-producing siblings like group_by and time_series.

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 description explicitly routes non-transaction quota/credit questions to get_credits and explains the mutable default scope and how to narrow it. It does not explicitly mention sibling tools like group_by, time_series, or top_n, but the 'single metric' wording strongly implies they are for different use cases, so agents have to infer the boundary with them.

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.