Skip to main content
Glama

Classify a contract as recurring or not

classify_revenue
Read-onlyIdempotent

Apply the GASP year-or-renewal test to a contract, its lines, or a subscription change to see whether it counts in MRR and ARR, where it is reported if it does not, and which metrics it reaches.

Instructions

Apply the GASP year-or-renewal test to a contract or a charge and name every metric it reaches. It answers three questions; pass kind, lines or change. (1) One contract (kind): does it count in MRR and ARR, where is it reported if it does not (Fixed-Term Revenue, Services Revenue, Consumption Revenue), can it churn and what are its first and last day reported as (New, Expansion, Reactivation, Churned or Contraction MRR, or nothing). A subscription counts when its contract runs 12 months or more or when a shorter plan renews; product access under 12 months with neither is fixed-term revenue. returning asks about a customer who churned and comes back and afterTrial about a free trial that converts. (2) A contract with several lines (lines): each line answered by its own kind and term, what they add up to and, with bundleValue or bundleMonthly, one bundle price shared across the lines by standalone price. (3) A change to a subscription the customer holds (change): an upgrade, a new module, a price increase, a downgrade, a price cut, a discount with an end date, a move to annual billing, a one-off credit, notice of a cancellation, a late payment or a customer who stops paying inside a committed term, with the movement and the tags its Revenue_Event carries. Every answer lists the metrics reached with a yes, a part or a no and the reason: MRR, ARR, Contracted ARR, Bookings, Billings, Annual Contract Value, Net and Gross Revenue Retention with their adjusted variants, Total, New and Churned Customers, Consumption Revenue, Usage Run-Rate and Prepaid Credit Balance. Pass amounts as the customer pays them, after any discount. Use it to settle whether a deal belongs in ARR, whether an expiry is churn, how a discount moves retention or how a pilot, an add-on, a term or perpetual licence, hardware, a credit pack or a services engagement is reported. The answer links the metric pages, the rulings at gaspwiki.com/v1/rulings that ask the same question and the calculator at gaspwiki.com/research/does-it-count opened on it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "classify_revenue"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoOne contract or charge. What is sold: subscription (product access on a plan or contract), term_licence (software licensed for a term, on-premises software included), perpetual_licence (a perpetual licence fee, charged once), hardware (hardware sold outright), add_on, pilot (a paid pilot or proof of concept), support (support, maintenance or a managed service on subscription terms), committed_usage (a contracted minimum), usage_above_commitment, on_demand_usage, credit_pack (credits bought once, automatic top-ups included), recurring_credits (credits billed every period), professional_services (delivered work), one_time_fee, free_trial
linesNoA contract with several lines, such as a subscription, an implementation fee and a credit pack. Each line is answered by its own kind and term. Pass it in place of `kind`
changeNoA change to a subscription the customer holds, in place of `kind`: upgrade (more of the same product), new_module, price_increase, downgrade (seats removed or a lower tier), price_cut (a price cut or a discount with no end date), temporary_discount (a discount with an end date), annual_billing_discount (a move to annual billing at a lower price), annual_billing_same_price, credit_or_refund (a one-off credit or refund), notice (notice to cancel on a later date, or a right to cancel the customer has not used), late_payment (a payment is late and the subscription stays open), unpaid_in_term (the customer stops paying inside a committed term and the contract stays in force)
renewsNoThe contract carries a renewal provision: it continues unless cancelled or the customer holds an option to renew
otherMrrNoThe customer holds MRR apart from this contract. It decides New against Expansion MRR at the start and Churned against Contraction MRR at the end. An add-on always sits beside a subscription. Read with `kind` and with `lines`
returningNoThe customer churned earlier and is coming back: a contract that counts starts as Reactivation MRR and the customer stays out of New Customers. Read for a customer with no other MRR, with `kind` and with `lines`
afterTrialNoThe contract starts on the day a free trial converts. Read for a new customer buying a contract that counts, with `kind` and with `lines`
termMonthsNoThe contract's term in months. Omit it for a contract with no end date, which runs until the customer cancels. Read for subscription, term_licence, add_on, pilot, support and committed_usage
bundleValueNoOne price for every line over the whole contract. Each line's own amount is then its standalone price and the bundle price is shared out in proportion. Needs an amount and an end date on every line
monthlyValueNoThe price per month, for a contract priced by the month, one with no end date or recurring_credits. Pass one of the two amounts: where both are given, a kind priced by the month is answered from monthlyValue and a kind sold once from contractValue. With `change` it is the customer's MRR before the change
bundleMonthlyNoOne price per month for every line, shared out the same way. Needs every line priced by the month
changeMonthlyNoThe size of the change per month as a positive amount, read with `change`. A decrease as large as the MRR before it is a cancellation: ask about the contract's end with `kind`
contractValueNoThe contract's value over its whole term, read with termMonths, or the amount charged for a kind sold once (professional_services, one_time_fee, perpetual_licence, hardware, credit_pack, on_demand_usage). A contract with no end date and recurring_credits take monthlyValue
followsEarlierTermNoThe contract follows an earlier term with no break in access, which makes it a renewal

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the description is not needed for safety. It does add genuine behavioral detail beyond them: every answer lists each metric reached with 'a yes, a part or a no and the reason', and the response links metric pages, matching rulings and a pre-loaded calculator. It stops short of describing error handling or how conflicting inputs (kind plus lines) are rejected.

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 core test is front-loaded, and the (1)/(2)/(3) mode markers help navigation. But the body is one very dense block that enumerates long metric and revenue-category lists, and the parenthetical enumerations of transaction types add reading burden without changing what an agent would pass.

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 14-parameter classifier with no output schema, the description covers mode selection, amount conventions, bundle arithmetic, and what the response contains, which is most of what an agent needs. Gaps are limited to failure behavior and how the tool behaves when required context for a mode is absent (all 14 parameters are technically optional).

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the per-field docs already carry the baseline. The description still adds cross-parameter meaning the schema does not: which mode each parameter belongs to ('pass `kind`, `lines` or `change`'), how bundleValue/bundleMonthly share price by standalone price, and that amounts must be passed 'as the customer pays them, after any discount'.

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 names a specific test (the GASP year-or-renewal test) applied to a specific resource (a contract or a charge) and spells out the three input modes (kind, lines, change). It is far from tautological, but it never names the sibling tools it differs from (e.g. lookup_definition, list_metrics), so the agent must infer the boundary from the wording 'Apply ... to a contract'.

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?

It gives explicit, concrete when-to-use cases: 'settle whether a deal belongs in ARR, whether an expiry is churn, how a discount moves retention or how a pilot, an add-on, a term or perpetual licence, hardware, a credit pack or a services engagement is reported.' It also routes between modes with 'Pass it in place of `kind`'. What is missing is any when-not guidance or named alternative for cases this tool does not answer.

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