Skip to main content
Glama
shukiv

blesta-mcp

by shukiv

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
BLESTA_URLYesInstall URL, e.g. https://billing.example.com or https://billing.example.com/api/ (both accepted)
BLESTA_API_KEYYesAPI key
BLESTA_API_USERYesAPI user name
BLESTA_STAFF_IDNoStaff member ID recorded on notes, suspensions and payments when a tool call gives none. Optional.
BLESTA_READ_ONLYNo1 blocks every non-GET call (safe default for support agents). Optional.
BLESTA_ALLOW_HTTPNo1 permits plain http:// URLs (local testing only). Optional.
BLESTA_CLIENT_URINoClient-area path used in payment links, default client/. Optional.
BLESTA_COMPANY_IDNoCompany for catalog calls; default is the first company Blesta reports. Optional.
BLESTA_PUBLIC_URLNoBase URL used in customer-facing links when it differs from BLESTA_URL. Optional.
BLESTA_SYSTEM_KEYNoBlesta.system_key from config/blesta.php. Needed by the payment-link tools on IonCube installs. Optional; alternative to BLESTA_SYSTEM_KEY_FILE.
BLESTA_TIMEOUT_MSNoHTTP timeout, default 30000. Optional.
BLESTA_ALLOW_PAYMENTSNo1 enables process_payment (charges stored payment accounts). Optional.
BLESTA_SYSTEM_KEY_FILENoPath to a file containing only the system key (preferred over the env var). Optional; alternative to BLESTA_SYSTEM_KEY.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
search_clientsA

Find customers matching a free-text query (email, first/last name, company, client ID code such as '1234'). Wraps Clients.search. Returns a page of client records including the primary contact's name, email and status. Use get_client with the returned id for full details.

get_clientA

Retrieve one customer by numeric client ID: identity, primary contact details (name, email, address, phone numbers), status (active/inactive/fraud), client group and, optionally, effective settings (currency, language, autodebit, ...). Wraps Clients.get.

get_client_contactsB

All contacts under a client (primary, billing, other) with name, email, address and phone/fax numbers. Wraps Contacts.getAll and Contacts.getNumbers.

get_client_notesA

Staff notes on a client account, newest first, plus pinned (sticky) notes. Read these before acting on an account. Wraps Clients.getNoteList, Clients.getNoteListCount and Clients.getAllStickyNotes.

get_client_balanceA

Amount the client owes in a currency (sum of open invoices) plus invoice counts by status (open, past_due, closed, ...). Wraps Invoices.amountDue and Invoices.getStatusCount. Use get_client with include_settings to learn the client's default currency.

add_client_noteA

Record a staff note on a client account (e.g. summary of a support interaction). Wraps Clients.addNote. staff_id defaults to BLESTA_STAFF_ID.

update_client_statusA

Set a client's status to active, inactive or fraud. Wraps Clients.edit(client_id, {status}). Inactive/fraud clients cannot log in; fraud also blocks orders.

search_invoicesA

Find invoices two ways. (1) query: free-text search by displayed invoice number, client name/email or line description (wraps Invoices.search). (2) client_id: list a customer's invoices filtered by status (wraps Invoices.getList; default status 'open'). Provide at least one of query or client_id. Each result includes numeric id, displayed id_code, status, dates, total, paid and due amounts.

get_invoiceA

Read one invoice by numeric invoice ID: displayed number (id_code), client_id, status, date_billed, date_due, date_closed, currency, subtotal, total, paid, due (total minus paid), taxes and line_items with descriptions, quantities and amounts. Wraps Invoices.get. Use search_invoices first if you only know the displayed invoice number.

create_invoiceA

Create a new invoice for a client with one or more line items. Wraps Invoices.add. Dates default to now (billed) and now+7 days (due). Set deliver_by_email to queue the invoice email (sent by Blesta's cron). Set draft to create it unissued. Returns the new numeric invoice ID and the invoice as stored.

send_invoiceA

Queue (re)delivery of an invoice to the client by email or another configured method. Wraps Invoices.addDelivery. Blesta's cron performs the actual send within a few minutes; the tool also returns the delivery log so you can see prior sends.

update_invoiceA

Edit invoice header fields: status (active/draft/proforma/void), due date, billed date, notes. Wraps Invoices.edit. Use status: "void" to void an unpaid invoice (irreversible in practice). Line items are not editable here; use blesta_call invoices/edit with lines for that.

get_client_servicesA

List a customer's services (hosting accounts, domains, add-ons) with status, package/pricing, renewal date and price. Wraps Services.getList (paged, default status 'active') and, when include_renewal_price is set, Services.getRenewalPrice per service. Pass service_id instead of client_id to fetch a single service (Services.get), including module fields such as domain/username. Results are compacted by default; set full for the raw Blesta objects.

search_servicesA

Find services across all clients by domain, hostname, username, package name or service number. Wraps Services.search (with search_fields to include module field values such as the domain). Returns compact service records with client_id.

get_service_actionsA

Which operations Blesta allows on a service in its current state (e.g. suspend, unsuspend, cancel, uncancel, change_renew_date, ...). Wraps Services.get + Services.getActions(current_status).

suspend_serviceB

Suspend a service (and, when use_module is true, tell the provisioning module to suspend the account). Wraps Services.suspend.

unsuspend_serviceA

Reactivate a suspended service (and on the module when use_module is true). Wraps Services.unsuspend.

cancel_serviceA

Cancel a service now, at end of the current term, or on a given date. Wraps Services.cancel. when: 'end_of_term' (default, safest), 'now' (immediate, module deprovisions if use_module), or an ISO 8601 date with timezone. Scheduled cancellations are executed by Blesta's cron and can be undone before then with blesta_call services/unCancel.

get_invoice_paymentsA

List payments (transactions) applied to an invoice: applied amount and date, transaction status (approved/declined/void/error/pending/returned), payment type, gateway, reference and transaction number. Wraps Transactions.getApplied(invoice_id). Set include_transaction_details to also fetch each full transaction record (Transactions.get). Also returns the invoice's current paid/due summary.

create_invoice_payment_linkA

Produce a customer-facing URL that lets the invoice be paid without logging in. Uses Invoices.createPayHash(client_id, invoice_id) then Encryption.systemEncrypt to build the sid token, exactly like Blesta's own payment reminder emails: {install}/client/pay/method/{invoice_id}/?sid=... . The link is tied to this client and invoice and does not expire. Only hand it to the invoice's own customer. Refuses if the invoice does not belong to client_id. On IonCube-encoded installs this call fails with 'Failed to retrieve the default value' unless BLESTA_SYSTEM_KEY is configured.

verify_invoice_payment_linkA

Check that a payment link/hash is valid for a given client and invoice, and report whether payment is still due. Accepts either the raw 16-character hash (with client_id) or the sid token / full payment URL (decrypted via Encryption.systemDecrypt). Wraps Invoices.verifyPayHash and Invoices.get. On IonCube-encoded installs this call fails with 'Failed to retrieve the default value' unless BLESTA_SYSTEM_KEY is configured.

get_client_transactionsA

Payment history for a client (or all clients): amount, currency, type (cc/ach/other), status, gateway, reference and which invoices each payment was applied to. Wraps Transactions.getList / getListCount. Filters: payment_type, reference_id, date and amount ranges, applied_status (fully_applied, partially_applied, not_applied).

get_transactionA

One payment in full plus the invoices it was applied to. Wraps Transactions.get and Transactions.getApplied(transaction_id).

get_payment_accountsA

Cards and bank accounts a client has on file (masked: last4, type, expiry, holder name, gateway reference). Never returns full numbers. Wraps Accounts.getAllCcByClient and Accounts.getAllAchByClient. Useful for autodebit failures and expired cards.

record_manual_paymentA

Record an offline payment (bank transfer, cash, check) and apply it to invoices. Wraps Transactions.add then Transactions.apply. Does not charge anything; it only records money already received. Omit apply_to to leave the amount as unapplied credit.

apply_transactionA

Apply an existing transaction's unapplied balance (client credit) to one or more invoices in the same currency. Wraps Transactions.apply.

process_paymentA

Charge a client's stored card or bank account through the payment gateway and apply the result to invoices. Wraps Payments.processPayment with account_id only; raw card data is never accepted. Sends the client a receipt unless disabled. Moves real money. DISABLED: set BLESTA_ALLOW_PAYMENTS=1 to enable.

list_packagesA

Product catalog: packages and package groups. Wraps Packages.getAll (compact view) and Packages.getAllGroups. Packages.getAll does not return prices; set include_pricing (max 25 packages per call, so filter by name or group first) to fetch Packages.get for each and attach pricing per term/period/currency. Pass full for raw objects incl. descriptions.

get_packageB

One package in full: pricing per term, description, module, configurable option groups, groups. Wraps Packages.get.

list_quotationsA

Quotes (estimates) for a client or across all clients, by status. Wraps Quotations.getList / getListCount. Statuses: draft, pending, approved, invoiced, expired, dead, lost, all.

get_quotationA

One quote with its line items and any invoices generated from it. Wraps Quotations.get, getLineItems, getInvoices.

lookup_couponA

Validate a promo code: existence, status, start/end dates, usage limits, discount amounts per currency, eligible packages. Wraps Coupons.getByCode; with package_ids, also Coupons.getForPackages to check applicability.

blesta_callA

Escape hatch: call any public model method of the Blesta API as {model}/{method}. Parameters are passed BY NAME and must match the PHP method's argument names (see https://source-docs.blesta.com/classes/{Model}.html). Nested arrays/objects are supported (e.g. params: {"vars": {"client_id": 1, "lines": [{"description": "x", "amount": "5.00"}]}}). Plugin models use "plugin.model" (e.g. "support_manager.support_manager_tickets"). If http_method is omitted it is inferred from the method name (get*/search* -> GET, add* -> POST, edit*/set* -> PUT, delete* -> DELETE). Timestamps must include a timezone (e.g. 2026-01-31T12:00:00Z). If Blesta answers HTTP 500 'Failed to retrieve the default value', resend with every optional argument explicitly set. Any valid API key has full administrative power; prefer the purpose-built tools when one exists.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.8/5.0

Scored across 33 tools

Disambiguation5/5

Each tool targets a distinct resource+action combination, even in dense areas like payments (record_manual_payment vs apply_transaction vs process_payment are clearly separated by funding source and behavior). The only generic tool, blesta_call, is explicitly an escape hatch rather than a competing operation.

Naming Consistency4/5

Tool names overwhelmingly follow a snake_case verb_noun pattern (get_client, create_invoice, suspend_service). Minor deviations like lookup_coupon instead of get_coupon and list_quotations alongside get_quotation are predictable but not perfectly uniform.

Tool Count3/5

33 tools is heavy, but the breadth of Blesta's domain (clients, invoices, services, payments, packages, quotes, coupons) justifies most of them. The count sits above the typical heavy range and some getters could potentially be consolidated, yet no tool feels truly redundant.

Completeness3/5

Core client, invoice, service, and payment operations are well covered, including search, retrieve, and common state changes. Notable gaps exist (no create_client, no package/quote creation, no direct line-item editing), though blesta_call provides a workaround for advanced operations.

Maintenance

ActivityMaintained
ResponsivenessNo issues