Skip to content

Entitlement programs: check

The Entitlement Verbs check as MCP do programs, with inputs, result, refusals and an example.

Reference for Entitlement, one group of Entitlement programs.

Entitlement.check

Check says whether a Customer may call a Verb now, how much of its Limit remains, when that resets, and which Offer lifts it. Verb page.

Text
do: return await $.Entitlement.check(input)

Emits Entitlement.checked.

Inputs

InputTypeRequiredDescription
customerCustomerrequiredThe Customer making the call.
verbVerbrequiredThe Verb it wants to call, as Noun.verb.
amountintegerHow many units the call would use. Defaults to 1.

Returns

OutputTypeRequiredDescription
allowedbooleanrequiredTrue when an Entitlement grants the call and its Limit has room for amount.
entitlementEntitlementThe Entitlement that grants the Verb, when one does.
remainingintegerUnits left in the current period; absent for a feature Entitlement.
resetsAtdatetimeWhen the period resets; absent when the Limit never resets.
upgradeOfferThe Offer that lifts the bound, when its Offer’s atBound is upgrade.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Entitlement.check({ customer: 'cus_K1BROJhqzZ', verb: 'verb_hlkWBvrAyZ' })"
  }
}