whmcs_create_quote
Create a new quote in WHMCS with subject, stage, validity date, client details, and notes for proposals and administration.
Instructions
Create a new quote
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subject | Yes | Quote subject | |
| stage | Yes | Quote stage | |
| validuntil | Yes | Valid until date (YYYY-MM-DD) | |
| userid | No | Client ID | |
| firstname | No | First name | |
| lastname | No | Last name | |
| companyname | No | Company name | |
| No | |||
| proposal | No | Proposal text | |
| customernotes | No | Customer notes | |
| adminnotes | No | Admin notes |
Implementation Reference
- src/index.ts:1247-1252 (handler)The handler function that executes the whmcs_create_quote tool logic by invoking the WHMCS client's createQuote method and returning a formatted JSON response.async (params) => { const result = await whmcsClient.createQuote(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:1234-1245 (schema)Zod input schema for the whmcs_create_quote tool, defining required and optional parameters like subject, stage, validuntil, and client details.subject: z.string().describe('Quote subject'), stage: z.enum(['Draft', 'Delivered', 'On Hold', 'Accepted', 'Lost', 'Dead']).describe('Quote stage'), validuntil: z.string().describe('Valid until date (YYYY-MM-DD)'), userid: z.number().optional().describe('Client ID'), firstname: z.string().optional().describe('First name'), lastname: z.string().optional().describe('Last name'), companyname: z.string().optional().describe('Company name'), email: z.string().optional().describe('Email'), proposal: z.string().optional().describe('Proposal text'), customernotes: z.string().optional().describe('Customer notes'), adminnotes: z.string().optional().describe('Admin notes'), },
- src/index.ts:1228-1253 (registration)Registration of the whmcs_create_quote tool with the MCP server, including title, description, input schema, and handler reference.server.registerTool( 'whmcs_create_quote', { title: 'Create Quote', description: 'Create a new quote', inputSchema: { subject: z.string().describe('Quote subject'), stage: z.enum(['Draft', 'Delivered', 'On Hold', 'Accepted', 'Lost', 'Dead']).describe('Quote stage'), validuntil: z.string().describe('Valid until date (YYYY-MM-DD)'), userid: z.number().optional().describe('Client ID'), firstname: z.string().optional().describe('First name'), lastname: z.string().optional().describe('Last name'), companyname: z.string().optional().describe('Company name'), email: z.string().optional().describe('Email'), proposal: z.string().optional().describe('Proposal text'), customernotes: z.string().optional().describe('Customer notes'), adminnotes: z.string().optional().describe('Admin notes'), }, }, async (params) => { const result = await whmcsClient.createQuote(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );
- src/whmcs-client.ts:1445-1474 (helper)Supporting method in WhmcsApiClient class that performs the actual WHMCS API call to the 'CreateQuote' action using the generic call method with parameter flattening.async createQuote(params: { subject: string; stage: 'Draft' | 'Delivered' | 'On Hold' | 'Accepted' | 'Lost' | 'Dead'; validuntil: string; userid?: number; firstname?: string; lastname?: string; companyname?: string; email?: string; address1?: string; address2?: string; city?: string; state?: string; postcode?: string; country?: string; phonenumber?: string; currency?: number; proposal?: string; customernotes?: string; adminnotes?: string; lineitems?: Array<{ desc: string; qty: number; up: number; discount: number; taxable: boolean; }>; }) { return this.call<WhmcsApiResponse & { quoteid: number }>('CreateQuote', params); }