Skip to main content
Glama
gura105

Operational Ontology

aggregate_product

Count selected products and sum their stock, optionally grouped by product properties. Get totals and member product keys for client-side filtering and further analysis.

Instructions

Count the selected Product objects and optionally sum a numeric property. Omit group_by for one whole-set total (key: null, zero metrics for an empty set), or group by a property. Returns set and values; each row has a key, member pks and numeric metrics. Filter rows in client-side code and use their pks to continue exploring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pksYes
sumNo
group_byNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.2
    • changedInput schema / required
      Previous value: -[
      -  "pks",
      -  "group_by"
      -]New value: +[
      +  "pks"
      +]
  2. Changed4 schema fields changedv0.5.1
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / filter
      Removed value: -{
      -  "properties": {
      -    "id": {
      -      "type": "string"
      -    },
      -    "name": {
      -      "type": "string"
      -    },
      -    "stock": {
      -      "type": "number"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedInput schema / properties / pks
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "group_by"
      -]New value: +[
      +  "pks",
      +  "group_by"
      +]
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden and does a good job: it discloses the return shape ('Returns set and values; each row has a key, member pks and numeric metrics'), the empty-set behavior ('key: null, zero metrics for an empty set'), and the client-side filtering follow-up. It does not explicitly state that the operation is read-only or side-effect-free, but the counting/summing framing strongly implies it; the added detail still goes well beyond a minimal description.

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?

Three sentences with no filler: the core action comes first, grouping semantics follow, and output/follow-up guidance closes. Every sentence adds relevant information, and the structure is front-loaded so an agent can quickly decide whether to call the tool.

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?

This tool has no output schema, so the description adequately explains return values, including the empty-set case and the meaning of row fields. It does not explicitly enumerate the exact allowed values for sum and group_by, but the input schema's enums provide that. The note about filtering rows and using their pks to continue exploring adds useful workflow context. Overall, the description is complete enough for correct invocation.

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 0%, so the description must compensate for parameter meaning. It explains pks as 'selected Product objects' and clarifies the role of group_by, which is valuable. However, it uses vague phrases like 'sum a numeric property' and 'group by a property' instead of naming the allowed enum values (stock, id, name), leaving the schema to fill an important gap in precise parameter semantics.

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 specific verb and resource: 'Count the selected Product objects and optionally sum a numeric property.' This clearly identifies an aggregation action on productshare and distinguishes it from generic names like search_product or get_product. The optional grouping and summing are also stated, giving immediate functional orientation.

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

Usage Guidelines3/5

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

The description provides within-tool usage guidance, such as 'Omit group_by for one whole-set total' and 'group by a property,' which is helpful for how to configure the call. However, it does not explicitly explain when to choose this tool over sibling tools like aggregate_order or pivot_* tools, nor does it state prerequisites like 'use after selecting products.' The workflow hint to 'continue exploring' implies context but does not explicitly route the agent away from alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.