create_quote
Generate new quotes in Autotask PSA by specifying company details, contact information, opportunity associations, and validity dates for professional service agreements.
Instructions
Create a new quote
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Quote name | |
| description | No | Quote description | |
| companyId | Yes | Company ID for the quote | |
| contactId | No | Contact ID for the quote | |
| opportunityId | No | Associated opportunity ID | |
| effectiveDate | No | Effective date (YYYY-MM-DD format) | |
| expirationDate | No | Expiration date (YYYY-MM-DD format) |
Implementation Reference
- src/handlers/tool.handler.ts:843-880 (schema)MCP tool definition including schema for 'create_quote' - specifies inputSchema with required companyId and optional fields like name, description, contactId, etc. This is returned by listTools() for tool registration.{ name: 'create_quote', description: 'Create a new quote', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Quote name' }, description: { type: 'string', description: 'Quote description' }, companyId: { type: 'number', description: 'Company ID for the quote' }, contactId: { type: 'number', description: 'Contact ID for the quote' }, opportunityId: { type: 'number', description: 'Associated opportunity ID' }, effectiveDate: { type: 'string', description: 'Effective date (YYYY-MM-DD format)' }, expirationDate: { type: 'string', description: 'Expiration date (YYYY-MM-DD format)' } }, required: ['companyId'] } },
- src/types/autotask.ts:240-251 (schema)TypeScript interface defining the structure of AutotaskQuote objects used as input/output for quote operations.export interface AutotaskQuote { id?: number; companyID?: number; contactID?: number; quoteNumber?: string; quoteDate?: string; title?: string; description?: string; totalAmount?: number; status?: number; [key: string]: any; }
- src/handlers/tool.handler.ts:1287-1298 (handler)Handler dispatch in AutotaskToolHandler.callTool() - maps tool arguments to service call and formats result for MCP response.case 'create_quote': result = await this.autotaskService.createQuote({ name: args.name, description: args.description, companyID: args.companyId, contactID: args.contactId, opportunityID: args.opportunityId, effectiveDate: args.effectiveDate, expirationDate: args.expirationDate }); message = `Successfully created quote with ID: ${result}`; break;
- Core implementation in AutotaskService.createQuote() - initializes client if needed and calls autotask-node client.quotes.create() to perform the API operation.async createQuote(quote: Partial<AutotaskQuote>): Promise<number> { const client = await this.ensureClient(); try { this.logger.debug('Creating quote:', quote); const result = await client.quotes.create(quote as any); const quoteId = (result.data as any)?.id; this.logger.info(`Quote created with ID: ${quoteId}`); return quoteId; } catch (error) { this.logger.error('Failed to create quote:', error); throw error; } }