Skip to main content
Glama

whmcs_update_client

Update client information in WHMCS by modifying details like contact data, address, status, or password for existing customers.

Instructions

Update an existing client in WHMCS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientidYesThe client ID to update
firstnameNoClient first name
lastnameNoClient last name
emailNoClient email address
companynameNoCompany name
address1NoStreet address
address2NoAddress line 2
cityNoCity
stateNoState/Province
postcodeNoPostal/ZIP code
countryNoCountry (2-letter ISO code)
phonenumberNoPhone number
password2NoNew password
statusNoClient status (Active, Inactive, Closed)
creditNoCredit balance
notesNoAdmin notes
languageNoClient language

Implementation Reference

  • Core handler implementation in WhmcsApiClient.updateClient that performs the WHMCS 'UpdateClient' API call with provided parameters.
    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); }
  • src/index.ts:124-154 (registration)
    Registers the 'whmcs_update_client' tool with MCP server, including schema validation and thin handler wrapper calling WhmcsApiClient.updateClient.
    '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) }], }; } );
  • Zod input schema defining parameters and validation for the whmcs_update_client tool.
    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'), },
  • Generic API call method used by updateClient to send HTTP POST request to WHMCS API endpoint with authentication and error handling.
    async call<T extends WhmcsApiResponse>(action: string, params: Record<string, unknown> = {}): Promise<T> { const url = `${this.config.apiUrl.replace(/\/$/, '')}/includes/api.php`; const postData: Record<string, string> = { identifier: this.config.apiIdentifier, secret: this.config.apiSecret, action: action, responsetype: 'json', ...this.flattenParams(params) }; if (this.config.accessKey) { postData.accesskey = this.config.accessKey; } const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams(postData).toString(), }); if (!response.ok) { throw new Error(`WHMCS API request failed: ${response.status} ${response.statusText}`); } const data = await response.json() as T; if (data.result === 'error') { throw new Error(`WHMCS API error: ${data.message || 'Unknown error'}`); } return data; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scarecr0w12/whmcs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server