Skip to main content
Glama
gura105

Operational Ontology

aggregate_customer

Count selected customers and sum numeric properties, with optional grouping by fields such as region. Returns per-group keys and member primary keys for further filtering.

Instructions

Count the selected Customer 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
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"
      -    },
      -    "region": {
      -      "type": "string"
      -    }
      -  },
      -  "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

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the empty-set behavior ('zero metrics for an empty set') and the return structure ('each row has a key, member pks and numeric metrics'), which is useful. However, it doesn't state whether the operation is read-only, doesn't cover grouped empty-set behavior, and is silent on potential side effects. It adds some context but not comprehensive.

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 three sentences, front-loaded with the primary purpose. It is efficient, with no filler, though some details (like the sum property) are missing rather than excessive. Structure is logical: action, parameter behavior, return format, and client-side usage.

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

Completeness2/5

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

The tool has two parameters and no output schema, so the description must fully explain inputs and outputs. It covers the return structure and empty-set case, but omits critical information: the identity of the numeric property to sum, and edge cases for grouped empty sets. The missing sum parameter makes the tool incomplete for its stated optional functionality, so agents cannot reliably use it as intended.

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

Parameters2/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 explain parameters. It explains group_by usage and implies pks are customer identifiers, but it fails to specify which numeric property is summed ('optionally sum a numeric property' with no parameter to select it). This is a critical gap—the agent cannot correctly invoke the sum functionality based on this description. Group_by is clarified, but pks semantics are vague.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action ('Count the selected Customer objects') and a resource ('Customer objects'), distinguishing it from search/get operations. It also mentions an optional sum, but doesn't explicitly name sibling aggregation tools (aggregate_order, etc.), so it lacks explicit differentiation. Still, the verb+resource is specific enough.

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 explains parameter usage ('Omit group_by for one whole-set total... or group by a property') and advises client-side filtering, but it does not state when to choose this tool over alternatives like search_customer or set operations. No exclusions or explicit comparisons to siblings are provided, leaving selection to inference.

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