Get Domain Lock Status
whmcs_get_domain_lock_statusRetrieves the current lock or unlock status for a domain using its ID. Helps determine if a domain is protected against unauthorized transfers.
Instructions
Get lock/unlock status for a domain
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domainid | Yes | Domain ID |
Implementation Reference
- src/index.ts:715-730 (registration)Registration of the 'whmcs_get_domain_lock_status' tool with MCP server, defining its name, description, input schema (domainid), and handler that delegates to whmcsClient.getDomainLockingStatus()
server.registerTool( 'whmcs_get_domain_lock_status', { title: 'Get Domain Lock Status', description: 'Get lock/unlock status for a domain', inputSchema: { domainid: z.number().describe('Domain ID'), }, }, async (params) => { const result = await whmcsClient.getDomainLockingStatus(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:720-723 (schema)Input schema for the tool: expects a single required 'domainid' parameter of type number
inputSchema: { domainid: z.number().describe('Domain ID'), }, }, - src/whmcs-client.ts:905-907 (handler)The actual handler/helper method on WhmcsApiClient that calls the WHMCS API action 'DomainGetLockingStatus' with the given domainid, returning a response containing lockstatus string
async getDomainLockingStatus(params: { domainid: number }) { return this.call<WhmcsApiResponse & { lockstatus: string }>('DomainGetLockingStatus', params); } - src/whmcs-client.ts:29-63 (helper)The underlying API client 'call' method that all tools use to make HTTP POST requests to the WHMCS API endpoint
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; } - src/whmcs-client.ts:895-900 (helper)Related helper: updateDomainLockingStatus method that calls the sibling WHMCS API action for updating domain lock status
async updateDomainLockingStatus(params: { domainid: number; lockstatus?: boolean; }) { return this.call<WhmcsApiResponse>('DomainUpdateLockingStatus', params); }