Skip to main content
Glama

Define rollup

define_rollup
Destructive

Create a derived-metric rollup that aggregates a custom source object onto a target field (e.g. usage_revenue = sum of usage records onto an account field). agg is sum/count/avg/min/max. The source must be a custom object; ARR/renewal fields are system-owned and can't be targets. Returns the created rollup. An existing rollup is edited with update_record / delete_record on object_type "rollup" (its id and key come from describe_schema).

When to use: When an admin wants a computed field — e.g. usage revenue summed from usage records onto the account.

Example: Roll up usage records into a usage_revenue field on the account.

Input Schema

NameRequiredDescriptionDefault
aggYesAggregation: sum, count, avg, min or max. Every kind except count needs agg_field.
keyYesStable name for the rollup, slugified to lowercase/underscores; unique per workspace.
agg_fieldNoThe numeric source field key to aggregate; required unless agg is count (null then). For an account source only current_arr_cents.
filter_specNoOptional numeric filters on source records, [{key, op, value}] with op one of eq/neq/gt/gte/lt/lte; key is a source data key, value a number (non-numeric clauses are skipped). Not supported when source_object is account.
source_linkYesThe relationship field key on the source whose value is the target record's id — it decides which source records roll up to each target.
target_fieldYesField key on the target that stores the result (a custom field on a built-in target, a data key on a custom one); current_arr_cents and renewal_due_at are refused.
source_objectYesObject whose records are aggregated: a custom object, or account (then agg_field may only be current_arr_cents).
target_objectYesObject key whose records receive the value — a built-in one (account, contact, opportunity, subscription, touch, signal, task) or a custom object.

Output Schema

NameRequiredDescriptionDefault
rollupNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / agg_field / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / agg_field / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  2. Changed1 schema field changed
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
  3. Changed4 schema fields changed
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / rollup / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / rollup / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
  4. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare destructiveHint=true and idempotentHint=false, and the description adds real constraint context beyond that: the source must be a custom object, ARR/renewal fields are system-owned and cannot be targets, and it returns the created rollup. It does not explain why the operation is destructive or whether an existing rollup with the same key is overwritten, which is the one gap against the destructive annotation.

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 core definition and its constraints are front-loaded in the first three sentences, with the alternative-editing path and the example trailing as supporting detail. The 'When to use' line and the example restate ideas already introduced, so it is slightly longer than strictly necessary but not padded.

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?

With an output schema present, the description needn't explain return values (though it notes 'Returns the created rollup'), and it covers the key domain constraints for an 8-parameter, 6-required tool. What remains unstated is the failure/conflict behavior implied by destructiveHint=true and idempotentHint=false.

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 100%, so the schema already explains key, agg, agg_field, filter_spec, source_link, source_object and target_object in detail; the baseline is therefore 3. The description reinforces the source/target restrictions (custom object only, ARR/renewal refused) but adds no syntax or format information the schema lacks.

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?

Uses a specific verb+resource ('Create a derived-metric rollup that aggregates a custom source object onto a target field') and immediately clarifies what that means with a concrete example (usage_revenue = sum of usage records). It also distinguishes itself from the generic create_record/update_record siblings by stating that editing an existing rollup goes through update_record/delete_record on object_type "rollup".

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

Usage Guidelines5/5

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

Explicitly names the situation ('when an admin wants a computed field') and routes the agent away from this tool for the editing case, specifying the exact alternative path (update_record / delete_record on object_type "rollup", with id/key from describe_schema). The alternative and the condition that selects it are both stated, leaving nothing 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