Aller au contenu

Tools · Credits

MCP tools for booking credits: balance, statement, the company wallet, granting, adjusting and taking back credits, and the community rules (accrual, cancellation window, late cancellation and no-shows). Minimum role and recipes.

Cet article n’a pas encore été traduit. Vous lisez la version en anglais.

Credits through the assistant: seeing the balance and the statement (your own or, for the team, any member's), the wallet of a company, granting and adjusting credits, taking them back, and reading or changing the community rules. The credits of plans and products are set with create_plan and update_plan (monthly_credits) and create_product and update_product (granted_credits and granted_credits_validity_days); in a community with no Bookings or Scheduling space, the assistant explains that one has to be created first.

Each tool carries a badge: Read-only changes nothing, Changes creates or changes something right away, and Asks to confirm only acts after your yes to a summary. See Money and confirmation.

In short

ToolWhat it doesMinimum roleType
get_credit_balanceThe balance, what expires in 7 days and the batchesAny (yours); team (someone else's)Read-only
list_credit_entriesThe statement, newest firstAny (yours); team (someone else's)Read-only
get_company_credit_balanceThe wallet balance of a companyAny (the API checks who reads)Read-only
list_company_credit_entriesThe company wallet statement, with who used itAny (the API checks who reads)Read-only
grant_creditsOpens a new batch of credits, with a reasonFinanceAsks to confirm
adjust_creditsAdds credits as a correction, with a reasonFinanceAsks to confirm
revoke_creditsTakes credits back (negative adjustment)FinanceAsks to confirm
get_credit_settingsThe community's credit rulesModerator (or finance)Read-only
update_credit_settingsChanges the rulesAdminChanges

"Finance" here means owner, admin or finance; the moderator only reads. "Team" is the owner, the admin, the moderator and finance. The roles are the routes' roles: the assistant never does more than the connected person could do on screen. The platform variable that decides whether a paused or past-due subscription keeps using its balance belongs to the SuperAdmin and has no tool.

get_credit_balance

Read-only

The balance. The usable balance (the sum of the batches that haven't expired; it can be negative, which blocks booking), what expires in the next 7 days and the batches, each with its source (Plan, Product or Team), how much is left and when it expires. Minimum role: any (yours); the team reads any member's.

ParameterTypeRequiredDescription
member_ididNoTeam only: whose. Without it, it's yours (a member asking for someone else's is refused)

Whoever is on a company with a wallet also gets company (the company's id, name and balance), to choose which balance to book with.

Ask like this: "How many credits do I have?" · "What is Maria Souza's balance?"

list_credit_entries

Read-only

The statement. Each entry with its type (grant, used on a booking, refund, adjustment, expiration, revocation), the signed amount, the source, the booking, product or subscription behind it and the reason. The ledger only grows: nothing is edited or deleted. Paginated.

ParameterTypeRequiredDescription
member_ididNoTeam only: whose. Without it, it's yours
kindGRANT, DEBIT, REFUND, ADJUSTMENT, EXPIRATION or REVOCATIONNoFilters by type
page, limitnumberNoPagination (limit up to 200)

Ask like this: "Show Maria's credit statement for this month."

get_company_credit_balance

Read-only

The company's balance. The wallet of a company: the credits of the plans the company bought and the manual grants, which its team spends on bookings (pay_with: company). Same shape as get_credit_balance, plus company (id and name). Readers are the owner, the admin, finance and that company's admin; the moderator and a plain employee get "no permission" (the employee sees the company balance in get_credit_balance). Minimum role: any (the API checks who reads).

ParameterTypeRequiredDescription
company_ididYesThe company (from list_companies or get_my_company)

Ask like this: "How many credits does Acme have left?"

list_company_credit_entries

Read-only

The company's statement, newest first, like list_credit_entries; on booking uses, usedBy says who on the team used them. Same access as get_company_credit_balance. Paginated.

ParameterTypeRequiredDescription
company_ididYesThe company (from list_companies or get_my_company)
kind, page, limitNoAs in list_credit_entries

Ask like this: "Who at Acme used the company's credits this month?"

grant_credits

Asks to confirm

Grant credits. Opens a new batch with a required reason and an optional validity (without it, they don't expire). Before acting, it shows a summary and only repeats the call after your yes. Returns the new balance and the entry. Minimum role: finance.

ParameterTypeRequiredDescription
member_id or company_ididOne of the twoThe member (list_members) or the company wallet (owner and admin only)
amountinteger, 1 to 100,000YesHow many credits
reasontext (up to 255)YesThe reason: it stays in the statement
expires_atfuture date and timeNoWhen they expire; without it or null, never

Ask like this: "Give John 10 courtesy credits, valid until the end of the month, because he referred a new member."

adjust_credits

Asks to confirm

Adjust upward. Adds credits as a correction (an adjustment entry: it's the way to fix a mistake, since the ledger never edits). Same parameters as grant_credits (up to 100,000 at a time), and it also asks to confirm. To take credits away, use revoke_credits, which asks to confirm. Minimum role: finance.

revoke_credits

Asks to confirm

Take credits back. A negative adjustment, with a required reason. It uses the batches that expire first and doesn't go beyond the usable balance (otherwise, 409: read the balance first). Before acting, it shows a summary (how much, the balance now, the balance after and the reason) and only repeats the call with the confirmation_token after an explicit yes. Minimum role: finance.

ParameterTypeRequiredDescription
member_id or company_ididOne of the twoThe member or the company wallet (owner and admin only)
amountinteger, 1 or moreYesHow many credits to remove
reasontextYesThe reason

get_credit_settings

Read-only

The rules. Accrual (on, cap, months), first-month proration, cancellation window in hours, whether late cancellation and no-shows lose the credit, and the days of expiry notice. Minimum role: moderator (or finance).

update_credit_settings

Changes

Change the rules. Changes only what you send. It applies from the next month turnover on and never changes a batch that already exists. Minimum role: admin.

ParameterTypeDescription
rollover_enabledtrue or falseCarry plan credits over to the next month (default: no)
rollover_capinteger or nullThe cap on what carries over; null, no cap
rollover_max_cycles1 to 12For how many months the accumulated credit is valid
prorate_first_monthtrue or falseShare for the days left in the first month
change_window_hours0 to 720Window to cancel or change without losing (default: 24)
late_cancel_loses_creditstrue or falseLate cancellation loses the credit (default: yes)
no_show_loses_creditstrue or falseA no-show loses the credit (default: yes)
expiry_notice_days0 to 30Days of notice before expiring (0 = no notice)

Ask like this: "Turn on credit accrual, with a cap of 20, for 2 months, and set the cancellation window to 12 hours."