whmcs_get_support_departments
Retrieve support department listings from WHMCS to manage ticket routing and organizational structure.
Instructions
Get list of support departments
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ignore_dept_assignments | No | Ignore department assignments |
Implementation Reference
- src/index.ts:551-565 (registration)Registration of the 'whmcs_get_support_departments' MCP tool. Defines the tool name, title, description, input schema using Zod, and the handler function that calls whmcsClient.getSupportDepartments() and formats the response.'whmcs_get_support_departments', { title: 'Get Support Departments', description: 'Get list of support departments', inputSchema: { ignore_dept_assignments: z.boolean().optional().describe('Ignore department assignments'), }, }, async (params) => { const result = await whmcsClient.getSupportDepartments(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );
- src/whmcs-client.ts:779-789 (handler)Core handler implementation in WhmcsApiClient class. Makes authenticated API call to WHMCS 'GetSupportDepartments' action with provided params, returning departments list with counts of open/awaiting tickets.async getSupportDepartments(params: { ignore_dept_assignments?: boolean } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; departments: { department: Array<{ id: number; name: string; awaitingreply: number; opentickets: number; }> }; }>('GetSupportDepartments', params); }
- src/index.ts:555-557 (schema)Zod input schema for the tool, defining optional 'ignore_dept_assignments' boolean parameter.inputSchema: { ignore_dept_assignments: z.boolean().optional().describe('Ignore department assignments'), },
- src/whmcs-client.ts:780-788 (schema)TypeScript type definition for the expected response from WHMCS GetSupportDepartments API, including totalresults and array of departments with id, name, and ticket counts.return this.call<WhmcsApiResponse & { totalresults: number; departments: { department: Array<{ id: number; name: string; awaitingreply: number; opentickets: number; }> }; }>('GetSupportDepartments', params);