Skip to main content
Glama
This connector has been deprecated

This connector has been replaced by https://glama.ai/mcp/connectors/io.phas/phasio

aggregate

Read-onlyIdempotent

Aggregate a dataset: sum/avg/count/min/max of a field, optionally grouped by one or more fields, with an optional RSQL filter. Use this for cross-cutting questions like highest-value customers (aggregate order, sum, localPrice, groupBy=[customerOrganisationName], filter="state==ORDER") or revenue by process. Datasets that carry a voided/deleted flag exclude those rows by default (see the Scope line from describeQueryableFields); line-item datasets like requisition are NOT scoped by their parent order's status, so filter explicitly for placed-orders-only revenue. Datasets: order, partRevision, partSpecification, productionStep, customerOrganisation, cart, requisition, workOrder, processPrices, materialPrices, postProcessing, typescriptEquation, operationScheduling, operation, batchMovement, scrap, material, color, jurisdiction, leadTime, precisionPrices, infill, taxJurisdiction, taxComponent, paymentTerm, discount, shippingBox, shippingMethod, productionResource, routingTemplate, kanbanColumn, documentTemplate. Call describeQueryableFields(entity) for valid field names.

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": {
      "entity": "<entity>",
      "metric": "<metric>"
    },
    "name": "aggregate"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNo'asc' or 'desc' by the metric value (default desc).desc
fieldNoNumeric field to aggregate (required for all metrics except count). Use describeQueryableFields(entity) for valid names.
limitNoMax groups to return (1-50, default 20).
entityYesDataset to aggregate. One of: order, partRevision, partSpecification, productionStep, customerOrganisation, cart, requisition, workOrder, processPrices, materialPrices, postProcessing, typescriptEquation, operationScheduling, operation, batchMovement, scrap, material, color, jurisdiction, leadTime, precisionPrices, infill, taxJurisdiction, taxComponent, paymentTerm, discount, shippingBox, shippingMethod, productionResource, routingTemplate, kanbanColumn, documentTemplate.
filterNoOptional RSQL filter applied before aggregating (same syntax as query).
metricYessum, avg, count, min or max.
groupByNoOptional fields to group by (e.g. customerOrganisationName, technology). Omit for a single total.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / entity / enum
      Added value: +[
      +  "order",
      +  "partRevision",
      +  "partSpecification",
      +  "productionStep",
      +  "customerOrganisation",
      +  "cart",
      +  "requisition",
      +  "workOrder",
      +  "processPrices",
      +  "materialPrices",
      +  "postProcessing",
      +  "typescriptEquation",
      +  "operationScheduling",
      +  "operation",
      +  "batchMovement",
      +  "scrap",
      +  "material",
      +  "color",
      +  "jurisdiction",
      +  "leadTime",
      +  "precisionPrices",
      +  "infill",
      +  "taxJurisdiction",
      +  "taxComponent",
      +  "paymentTerm",
      +  "discount",
      +  "shippingBox",
      +  "shippingMethod",
      +  "productionResource",
      +  "routingTemplate",
      +  "kanbanColumn",
      +  "documentTemplate"
      +]
    • addedInput schema / properties / filter / minLength
      Added value: +1
    • addedInput schema / properties / groupBy / default
      Added value: +[]
    • addedInput schema / properties / limit / default
      Added value: +20
    • addedInput schema / properties / limit / maximum
      Added value: +50
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • addedInput schema / properties / metric / enum
      Added value: +[
      +  "sum",
      +  "avg",
      +  "count",
      +  "min",
      +  "max"
      +]
    • addedInput schema / properties / sort / default
      Added value: +"desc"
    • addedInput schema / properties / sort / enum
      Added value: +[
      +  "asc",
      +  "desc"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / entity / description
      Previous value: -"Dataset to aggregate. One of: order, partRevision, partSpecification, productionStep, customerOrganisation, cart, requisition, workOrder, processPrices, materialPrices, postProcessing, typescriptEquation, operation, batchMovement, scrap, material, color, jurisdiction, leadTime, precisionPrices, infill, taxJurisdiction, taxComponent, paymentTerm, discount, shippingBox, shippingMethod, routingTemplate, kanbanColumn, documentTemplate."New value: +"Dataset to aggregate. One of: order, partRevision, partSpecification, productionStep, customerOrganisation, cart, requisition, workOrder, processPrices, materialPrices, postProcessing, typescriptEquation, operationScheduling, operation, batchMovement, scrap, material, color, jurisdiction, leadTime, precisionPrices, infill, taxJurisdiction, taxComponent, paymentTerm, discount, shippingBox, shippingMethod, productionResource, routingTemplate, kanbanColumn, documentTemplate."
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond them by disclosing implicit row-scoping behavior (voided/deleted flags excluded by default, parent-order status not propagated) that materially changes results. It stops short of describing the shape of the returned data, which matters somewhat since there is no output schema.

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

Conciseness3/5

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

The first two sentences and the scoping caveats are well front-loaded and earn their place. The trailing enumeration of 32 dataset names is pure duplication of the entity enum in the schema and bloats the description without adding selecting power.

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 7-parameter read-only aggregation tool the description covers prerequisites (describeQueryableFields for valid field names), scoping subtleties, and when the tool applies. The one real gap is that, with no output schema, nothing tells the agent what the response looks like (group keys plus metric value, limit behavior).

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 coverage is 100%, so field/metric/limit/groupBy semantics are already documented; the description mostly restates them. It does add one concrete worked example combining field, metric, groupBy and filter on a real dataset, which clarifies interplay, but it adds no syntax detail for the RSQL filter beyond pointing at 'query'.

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?

Opens with a specific verb and resource plus the exact operation set: 'Aggregate a dataset: sum/avg/count/min/max of a field, optionally grouped by one or more fields, with an optional RSQL filter.' An agent immediately knows this produces grouped metrics rather than rows, which distinguishes it from the sibling 'query'.

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?

Provides concrete triggering scenarios ('highest-value customers', 'revenue by process') and important correctness caveats: default exclusion of voided/deleted rows, and that line-item datasets like requisition are not scoped by parent order status so explicit filtering is needed. It does not explicitly contrast with the 'query' sibling for row-level retrieval, so routing between the two is left partly to inference.

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