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

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault
rollupNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and readOnlyHint=false, so the safety profile is partly covered. The description adds real constraint context (system-owned ARR/renewal fields are refused as targets; source must be a custom object) and states that it returns the created rollup. However, it never explains the destructive/idempotency implications — e.g. what happens to existing target-field values or whether re-using an existing key overwrites or errors — which is the most consequential behavior for a non-idempotent, destructive-flagged creator.

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?

Well front-loaded: purpose, then key constraints, then the edit/edit-path routing, then when-to-use and an example. The one blemish is redundancy — the usage-revenue example appears twice (in the first sentence and again in the 'Example' line) and the agg enum duplicates the schema.

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, return values need not be explained (though it says 'Returns the created rollup' anyway), and the description covers creation intent, constraints, and the edit/delete path. The remaining gap is the non-idempotent lifecycle (what happens when the key already exists) and the source_object scope discrepancy with the schema.

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 documents all eight parameters in detail; baseline is 3. The description's parameter content is mostly redundant ('agg is sum/count/avg/min/max' restates the enum), and it introduces a mild inaccuracy: 'The source must be a custom object' contradicts the schema, which explicitly allows source_object='account' with agg_field limited to current_arr_cents. It adds little meaning and slightly over-restricts.

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 opening sentence gives a specific verb+resource ('Create a derived-metric rollup that aggregates a custom source object onto a target field') plus a concrete formula-shaped example (usage_revenue = sum of usage records onto an account field), so the agent knows exactly what artifact is produced. It also distinguishes the create path from the edit path by naming update_record/delete_record for existing rollups.

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?

There is an explicit 'When to use' line (an admin wants a computed field) and explicit routing for the alternative case: 'An existing rollup is edited with update_record / delete_record on object_type "rollup" (its id and key come from describe_schema).' This is exactly the when-to-use / when-not-to-use / alternative-tool guidance the dimension asks for.

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