MCP tools¶
22 tools: 15 that read, always available, and 7 that change something, offered only with PNLCS_ALLOW_WRITES=1.
Each tool is one API action and needs the same permission as that action.
Read tools¶
get_stats¶
Business overview: counts of clients, services, domains, invoices (and unpaid), orders (and pending), tickets (and open) and staff.
Calls the API action getstats with GET.
No arguments.
get_health¶
Health of the PNLCS install itself.
Calls the API action gethealthstatus with GET.
No arguments.
list_clients¶
List clients, oldest first unless sorting is DESC. Optional text search, status filter, ordering and paging.
Calls the API action getclients with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
search |
string | no | Match against name, email or company |
status |
string | no | active, inactive or closed |
orderby |
string | no | id (default), first_name, last_name, email, company_name, status or created_at |
sorting |
string | no | ASC (default) or DESC; DESC with orderby id lists the newest first |
limitnum |
integer | no | Page size, default 25 |
limitstart |
integer | no | Offset to start from |
get_client¶
One client with contacts, by clientid or email.
Calls the API action getclientsdetails with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
clientid |
integer | no | Client id |
email |
string | no | Client email, instead of the id |
list_client_services¶
Hosting services that belong to one client.
Calls the API action getclientsproducts with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
clientid |
integer | yes | Client id |
list_client_domains¶
Domains that belong to one client.
Calls the API action getclientsdomains with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
clientid |
integer | yes | Client id |
list_invoices¶
List invoices. Filter by status (draft, unpaid, paid, overdue, cancelled) or client.
Calls the API action getinvoices with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
status |
string | no | Invoice status |
userid |
integer | no | Only this client |
limitnum |
integer | no | Page size, default 25 |
limitstart |
integer | no | Offset to start from |
get_invoice¶
One invoice with its line items.
Calls the API action getinvoice with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
invoiceid |
integer | yes | Invoice id |
list_orders¶
List orders. Filter by status (pending, active, fraud, cancelled) or client.
Calls the API action getorders with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
status |
string | no | Order status |
userid |
integer | no | Only this client |
limitnum |
integer | no | Page size, default 25 |
limitstart |
integer | no | Offset to start from |
list_tickets¶
List support tickets. Filter by status.
Calls the API action gettickets with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
status |
string | no | Ticket status, e.g. open, answered, closed |
limitnum |
integer | no | Page size, default 25 |
limitstart |
integer | no | Offset to start from |
get_ticket¶
One ticket with its replies and notes.
Calls the API action getticket with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
ticketid |
integer | yes | Ticket id |
get_ticket_counts¶
Ticket totals per status.
Calls the API action getticketcounts with GET.
No arguments.
list_transactions¶
Payment transactions, newest first.
Calls the API action gettransactions with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
clientid |
integer | no | Only this client |
limitnum |
integer | no | Page size, default 25 |
limitstart |
integer | no | Offset to start from |
list_products¶
The product catalogue.
Calls the API action getproducts with GET.
No arguments.
get_activity_log¶
Recent admin and system activity.
Calls the API action getactivitylog with GET.
| Argument | Type | Required | Description |
|---|---|---|---|
limitnum |
integer | no | Entries to return, default 25 |
limitstart |
integer | no | Offset to start from |
Write tools¶
Warning
These exist only when PNLCS_ALLOW_WRITES=1 is set. Without it a call to one is refused before anything is sent to PNLCS.
add_client¶
Create a client. With password2 the client also gets a portal login.
Calls the API action addclient with POST.
| Argument | Type | Required | Description |
|---|---|---|---|
firstname |
string | yes | First name |
lastname |
string | yes | Last name |
email |
string | yes | Email, must be unused |
password2 |
string | no | Optional portal password, 8+ characters |
companyname |
string | no | Company |
country |
string | no | Two-letter country code |
create_invoice¶
Create an invoice for a client with one or more line items.
Calls the API action createinvoice with POST.
| Argument | Type | Required | Description |
|---|---|---|---|
userid |
integer | yes | Client id |
duedate |
string | no | Due date, YYYY-MM-DD |
items |
array | yes | Line items |
add_invoice_payment¶
Record a payment against an invoice. Marks it paid when it covers the balance.
Calls the API action addinvoicepayment with POST.
| Argument | Type | Required | Description |
|---|---|---|---|
invoiceid |
integer | yes | Invoice id |
transid |
string | yes | Transaction reference |
amount |
number | yes | Amount paid |
gateway |
string | no | Gateway name, defaults to banktransfer |
open_ticket¶
Open a support ticket on behalf of a customer, as staff.
Calls the API action openticket with POST.
| Argument | Type | Required | Description |
|---|---|---|---|
deptid |
integer | yes | Ticket department id |
subject |
string | yes | Subject |
message |
string | yes | Message body |
email |
string | yes | Email of the person the ticket is for |
priority |
string | no | low, medium, high or critical |
Always sends adminusername=staff.
add_ticket_reply¶
Reply to an existing ticket as staff. The customer is emailed the reply and the ticket becomes Answered.
Calls the API action addticketreply with POST.
| Argument | Type | Required | Description |
|---|---|---|---|
ticketid |
integer | yes | Ticket id |
message |
string | yes | Reply body |
Always sends adminusername=staff.
suspend_service¶
Suspend a hosting service on its server. Ask the operator before using this.
Calls the API action modulesuspend with POST.
| Argument | Type | Required | Description |
|---|---|---|---|
serviceid |
integer | yes | Service id |
reason |
string | no | Reason shown on the account |
unsuspend_service¶
Lift the suspension of a hosting service.
Calls the API action moduleunsuspend with POST.
| Argument | Type | Required | Description |
|---|---|---|---|
serviceid |
integer | yes | Service id |