Update Client
whmcs_update_clientUpdate an existing WHMCS client's information including contact details, status, and account settings.
Instructions
Update an existing client in WHMCS
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientid | Yes | The client ID to update | |
| firstname | No | Client first name | |
| lastname | No | Client last name | |
| No | Client email address | ||
| companyname | No | Company name | |
| address1 | No | Street address | |
| address2 | No | Address line 2 | |
| city | No | City | |
| state | No | State/Province | |
| postcode | No | Postal/ZIP code | |
| country | No | Country (2-letter ISO code) | |
| phonenumber | No | Phone number | |
| password2 | No | New password | |
| status | No | Client status (Active, Inactive, Closed) | |
| credit | No | Credit balance | |
| notes | No | Admin notes | |
| language | No | Client language |
Implementation Reference
- src/index.ts:123-154 (registration)Tool registration for 'whmcs_update_client' on the MCP server with schema definition and handler that delegates to whmcsClient.updateClient()
server.registerTool( 'whmcs_update_client', { title: 'Update Client', description: 'Update an existing client in WHMCS', inputSchema: { clientid: z.number().describe('The client ID to update'), firstname: z.string().optional().describe('Client first name'), lastname: z.string().optional().describe('Client last name'), email: z.string().email().optional().describe('Client email address'), companyname: z.string().optional().describe('Company name'), address1: z.string().optional().describe('Street address'), address2: z.string().optional().describe('Address line 2'), city: z.string().optional().describe('City'), state: z.string().optional().describe('State/Province'), postcode: z.string().optional().describe('Postal/ZIP code'), country: z.string().optional().describe('Country (2-letter ISO code)'), phonenumber: z.string().optional().describe('Phone number'), password2: z.string().optional().describe('New password'), status: z.string().optional().describe('Client status (Active, Inactive, Closed)'), credit: z.string().optional().describe('Credit balance'), notes: z.string().optional().describe('Admin notes'), language: z.string().optional().describe('Client language'), }, }, async (params) => { const result = await whmcsClient.updateClient(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:128-147 (schema)Zod input schema for whmcs_update_client - requires clientid, with optional fields for all updateable client properties
inputSchema: { clientid: z.number().describe('The client ID to update'), firstname: z.string().optional().describe('Client first name'), lastname: z.string().optional().describe('Client last name'), email: z.string().email().optional().describe('Client email address'), companyname: z.string().optional().describe('Company name'), address1: z.string().optional().describe('Street address'), address2: z.string().optional().describe('Address line 2'), city: z.string().optional().describe('City'), state: z.string().optional().describe('State/Province'), postcode: z.string().optional().describe('Postal/ZIP code'), country: z.string().optional().describe('Country (2-letter ISO code)'), phonenumber: z.string().optional().describe('Phone number'), password2: z.string().optional().describe('New password'), status: z.string().optional().describe('Client status (Active, Inactive, Closed)'), credit: z.string().optional().describe('Credit balance'), notes: z.string().optional().describe('Admin notes'), language: z.string().optional().describe('Client language'), }, }, - src/whmcs-client.ts:208-234 (handler)Actual handler logic: WhmcsApiClient.updateClient() method that calls the WHMCS API 'UpdateClient' action via the generic call() method
async updateClient(params: { clientid: number; firstname?: string; lastname?: string; companyname?: string; email?: string; address1?: string; address2?: string; city?: string; state?: string; postcode?: string; country?: string; phonenumber?: string; password2?: string; status?: string; credit?: string; taxexempt?: boolean; latefeeoveride?: boolean; overideduenotices?: boolean; separateinvoices?: boolean; disableautocc?: boolean; emailoptout?: boolean; language?: string; notes?: string; }) { return this.call<WhmcsApiResponse & { clientid: number }>('UpdateClient', params); }