Open Ticket
whmcs_open_ticketCreate a new support ticket in WHMCS by specifying department, subject, and message, with optional client, priority, and related services.
Instructions
Create a new support ticket
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deptid | Yes | Department ID | |
| subject | Yes | Ticket subject | |
| message | Yes | Ticket message/description | |
| clientid | No | Client ID | |
| contactid | No | Contact ID | |
| name | No | Name (if not a client) | |
| No | Email (if not a client) | ||
| priority | No | Ticket priority | |
| serviceid | No | Related service ID | |
| domainid | No | Related domain ID | |
| admin | No | Opened by admin | |
| markdown | No | Message contains markdown |
Implementation Reference
- src/index.ts:454-480 (registration)Registration of the 'whmcs_open_ticket' MCP tool with input schema and handler that delegates to whmcsClient.openTicket()
server.registerTool( 'whmcs_open_ticket', { title: 'Open Ticket', description: 'Create a new support ticket', inputSchema: { deptid: z.number().describe('Department ID'), subject: z.string().describe('Ticket subject'), message: z.string().describe('Ticket message/description'), clientid: z.number().optional().describe('Client ID'), contactid: z.number().optional().describe('Contact ID'), name: z.string().optional().describe('Name (if not a client)'), email: z.string().optional().describe('Email (if not a client)'), priority: z.enum(['Low', 'Medium', 'High']).optional().describe('Ticket priority'), serviceid: z.number().optional().describe('Related service ID'), domainid: z.number().optional().describe('Related domain ID'), admin: z.boolean().optional().describe('Opened by admin'), markdown: z.boolean().optional().describe('Message contains markdown'), }, }, async (params) => { const result = await whmcsClient.openTicket(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:459-473 (schema)Zod input schema for whmcs_open_ticket: requires deptid, subject, message; optional clientid, contactid, name, email, priority, serviceid, domainid, admin, markdown
inputSchema: { deptid: z.number().describe('Department ID'), subject: z.string().describe('Ticket subject'), message: z.string().describe('Ticket message/description'), clientid: z.number().optional().describe('Client ID'), contactid: z.number().optional().describe('Contact ID'), name: z.string().optional().describe('Name (if not a client)'), email: z.string().optional().describe('Email (if not a client)'), priority: z.enum(['Low', 'Medium', 'High']).optional().describe('Ticket priority'), serviceid: z.number().optional().describe('Related service ID'), domainid: z.number().optional().describe('Related domain ID'), admin: z.boolean().optional().describe('Opened by admin'), markdown: z.boolean().optional().describe('Message contains markdown'), }, }, - src/index.ts:474-479 (handler)Handler function that calls whmcsClient.openTicket(params) and returns JSON result
async (params) => { const result = await whmcsClient.openTicket(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/whmcs-client.ts:704-725 (helper)WhmcsApiClient.openTicket() - helper method that calls the WHMCS 'OpenTicket' API action, returning id, tid, and c fields on success
async openTicket(params: { deptid: number; subject: string; message: string; clientid?: number; contactid?: number; name?: string; email?: string; priority?: 'Low' | 'Medium' | 'High'; serviceid?: number; domainid?: number; admin?: boolean; markdown?: boolean; attachments?: Array<{ name: string; data: string }>; customfields?: string; }) { return this.call<WhmcsApiResponse & { id: number; tid: string; c: string; }>('OpenTicket', params); }