Get Support Departments
whmcs_get_support_departmentsRetrieve a list of support departments from WHMCS. Optionally ignore department assignments to fetch all departments.
Instructions
Get list of support departments
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "whmcs_get_support_departments"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ignore_dept_assignments | No | Ignore department assignments |
Implementation Reference
- src/index.ts:569-584 (registration)Registration of the 'whmcs_get_support_departments' tool via server.registerTool with input schema (optional ignore_dept_assignments boolean) and handler calling whmcsClient.getSupportDepartments(params).
server.registerTool( '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/index.ts:574-577 (schema)Input schema for whmcs_get_support_departments: optional 'ignore_dept_assignments' boolean parameter.
inputSchema: { ignore_dept_assignments: z.boolean().optional().describe('Ignore department assignments'), }, }, - src/index.ts:578-583 (handler)Handler function that delegates to whmcsClient.getSupportDepartments(params) and returns the JSON-stringified result.
async (params) => { const result = await whmcsClient.getSupportDepartments(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/whmcs-client.ts:790-802 (helper)getSupportDepartments method on WhmcsApiClient - makes the WHMCS API call to 'GetSupportDepartments' with optional ignore_dept_assignments parameter, returns typed response with department list (id, name, awaitingreply, opentickets).
* Get support departments */ 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); }