Skip to main content
Glama

Add Client

whmcs_add_client

Add a new client to your WHMCS installation by submitting their personal info, contact details, and password.

Instructions

Create a new client in WHMCS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstnameYesClient first name
lastnameYesClient last name
emailYesClient email address
address1YesStreet address
cityYesCity
stateYesState/Province
postcodeYesPostal/ZIP code
countryYesCountry (2-letter ISO code)
phonenumberYesPhone number
password2YesPassword for the client account
companynameNoCompany name
address2NoAddress line 2
currencyNoCurrency ID
languageNoClient language
groupidNoClient group ID
notesNoAdmin notes
noemailNoDo not send welcome email

Implementation Reference

  • src/index.ts:90-121 (registration)
    Tool registration for 'whmcs_add_client' - registers the tool with the MCP server, defining its input schema and handler that delegates to whmcsClient.addClient().
    server.registerTool(
        'whmcs_add_client',
        {
            title: 'Add Client',
            description: 'Create a new client in WHMCS',
            inputSchema: {
                firstname: z.string().describe('Client first name'),
                lastname: z.string().describe('Client last name'),
                email: z.string().email().describe('Client email address'),
                address1: z.string().describe('Street address'),
                city: z.string().describe('City'),
                state: z.string().describe('State/Province'),
                postcode: z.string().describe('Postal/ZIP code'),
                country: z.string().describe('Country (2-letter ISO code)'),
                phonenumber: z.string().describe('Phone number'),
                password2: z.string().describe('Password for the client account'),
                companyname: z.string().optional().describe('Company name'),
                address2: z.string().optional().describe('Address line 2'),
                currency: z.number().optional().describe('Currency ID'),
                language: z.string().optional().describe('Client language'),
                groupid: z.number().optional().describe('Client group ID'),
                notes: z.string().optional().describe('Admin notes'),
                noemail: z.boolean().optional().describe('Do not send welcome email'),
            },
        },
        async (params) => {
            const result = await whmcsClient.addClient(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • Input schema definition for 'whmcs_add_client' - defines Zod validation for client creation fields including required fields (firstname, lastname, email, address1, city, state, postcode, country, phonenumber, password2) and optional fields.
    inputSchema: {
        firstname: z.string().describe('Client first name'),
        lastname: z.string().describe('Client last name'),
        email: z.string().email().describe('Client email address'),
        address1: z.string().describe('Street address'),
        city: z.string().describe('City'),
        state: z.string().describe('State/Province'),
        postcode: z.string().describe('Postal/ZIP code'),
        country: z.string().describe('Country (2-letter ISO code)'),
        phonenumber: z.string().describe('Phone number'),
        password2: z.string().describe('Password for the client account'),
        companyname: z.string().optional().describe('Company name'),
        address2: z.string().optional().describe('Address line 2'),
        currency: z.number().optional().describe('Currency ID'),
        language: z.string().optional().describe('Client language'),
        groupid: z.number().optional().describe('Client group ID'),
        notes: z.string().optional().describe('Admin notes'),
        noemail: z.boolean().optional().describe('Do not send welcome email'),
    },
  • Handler implementation - WhmcsApiClient.addClient() method that calls the WHMCS API 'AddClient' action, returning the new clientid and owner_user_id.
    async addClient(params: {
        firstname: string;
        lastname: string;
        email: string;
        address1: string;
        city: string;
        state: string;
        postcode: string;
        country: string;
        phonenumber: string;
        password2: string;
        companyname?: string;
        address2?: string;
        currency?: number;
        clientip?: string;
        language?: string;
        groupid?: number;
        securityqid?: number;
        securityqans?: string;
        notes?: string;
        cardtype?: string;
        cardnum?: string;
        expdate?: string;
        startdate?: string;
        issuenumber?: string;
        cvv?: string;
        noemail?: boolean;
        skipvalidation?: boolean;
    }) {
        return this.call<WhmcsApiResponse & {
            clientid: number;
            owner_user_id: number;
        }>('AddClient', params);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only says 'Create a new client' but does not disclose side effects (e.g., welcome email sending, duplicate detection, or error behavior). The existence of a 'noemail' parameter suggests email behavior, but the description does not explain it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no unnecessary words. However, it could include slightly more context (e.g., required parameters) without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 17 parameters (10 required) and no output schema, the description fails to provide context about which fields are mandatory, what 'password2' represents, or any ordering or dependencies. The agent would need to rely solely on the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 17 parameters have descriptions in the schema (100% coverage). The description adds no additional meaning beyond what the schema already provides, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Create a new client in WHMCS' which is a specific verb ('Create') and resource ('client'). It distinguishes from siblings like whmcs_update_client and whmcs_delete_client.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool vs alternatives such as whmcs_update_client. There is no mention of preconditions like checking for existing email addresses or required setup steps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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-tool'

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