Skip to main content
Glama

Cancel subscription

cancel_subscription
Destructive

Cancel a subscription. Sets status='canceled', canceled_at, cancellation_category, cancellation_reason. Writes a subscription_events row of type 'canceled' with a negative mrr_delta. Trigger drops account.current_arr_cents. Returns a suggestion to set account.lifecycle_stage='churned' if this was the last active subscription. DESTRUCTIVE: confirm with the user first, then call again with confirm: true.

When to use: Customer cancellation. Always capture the cancellation_category for retention analysis.

Example: Acme cancelled — they consolidated to a competitor. Cancel the subscription effective today.

Input Schema

NameRequiredDescriptionDefault
idYesA uuid.
confirmNoBoolean (true/false).
canceled_atYesMust match /^\d{4}-\d{2}-\d{2}$/.
opportunity_idNoA uuid.
cancellation_reasonNoFree-text reason in the customer's words, stored on the subscription and as the 'canceled' event's note; cancellation_category is the coded bucket.
cancellation_categoryYesDefaults: price | product_fit | competitor | no_decision | business_change | support | consolidation | other. A workspace admin may rename or add values — see the live set in propose_updates' workspace.enum_values, or an admin's describe_schema.

Output Schema

NameRequiredDescriptionDefault
noteNo
accountNo
canceledNo
guidanceNo
subscriptionNo
requires_confirmNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / confirm / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  }
      -]
    • addedInput schema / properties / confirm / type
      Added value: +[
      +  "boolean",
      +  "string",
      +  "number"
      +]
  2. Changed1 schema field changed
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
  3. Changed5 schema fields changed
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / additionalProperties
      Removed value: -{}
    • changedOutput schema / properties / account / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": {},
      -    "properties": {
      -      "current_arr_cents": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "id": {
      -        "format": "uuid",
      -        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -        "type": "string"
      -      },
      -      "lifecycle_stage": {
      -        "type": "string"
      -      },
      -      "name": {
      -        "type": "string"
      -      },
      -      "renewal_due_at": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "name"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "The account's state — the same shape renew_subscription returns as `account`.",
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / subscription / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / subscription / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare destructiveHint=true, but the description goes well beyond that: it specifies the exact field mutations, the audit event written, the ARR rollup impact, the returned lifecycle suggestion, and the two-step confirm protocol ('confirm with the user first, then call again with confirm: true'). This is precisely the context an agent needs to avoid an irreversible mistake.

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?

Front-loads the action and side effects, then separates 'When to use' and an example. Nearly every sentence earns its place; the example adds marginal value over the when-to-use line, which keeps it just short of ideal density.

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

Completeness5/5

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

For a destructive mutation with an output schema present, the description covers effects, confirmation protocol, required inputs, and follow-up guidance. Nothing an agent needs to invoke it safely is missing.

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 baseline is 3, but the description adds real meaning: it explains why cancellation_category matters (retention analysis) and clarifies confirm's role as a two-phase confirmation gate, which the schema reduces to 'Boolean (true/false)'. It also implicitly disambiguates reason vs. category, though that distinction is already carried by the schema text.

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?

States a specific verb+resource ('Cancel a subscription') and immediately enumerates the exact state written (status='canceled', canceled_at, cancellation_category, cancellation_reason). The side-effect list (subscription_events row with negative mrr_delta, account.current_arr_cents drop) distinguishes it clearly from siblings like renew_subscription, update_record, or delete_record.

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?

'When to use: Customer cancellation' plus a worked example (Acme consolidating to a competitor) gives clear invocation context, and it directs the agent to always supply cancellation_category. It stops short of naming alternatives or when-not conditions (e.g., renew_subscription or restore_record), so it is clear but not exhaustive.

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