siigo_send_invoice_email
Send invoice emails from Siigo accounting software to recipients and CC contacts using invoice ID and email addresses.
Instructions
Send invoice by email
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Invoice ID | |
| mail_to | Yes | Recipient email | |
| copy_to | No | CC emails (semicolon separated) |
Implementation Reference
- src/siigo-client.ts:124-126 (handler)Core implementation of the tool: sends POST request to Siigo API endpoint /v1/invoices/{id}/mail with email data.async sendInvoiceByEmail(id: string, emailData: { mail_to: string; copy_to?: string }): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('POST', `/v1/invoices/${id}/mail`, emailData); }
- src/index.ts:962-973 (handler)MCP server handler method that parses tool arguments and calls SiigoClient.sendInvoiceByEmail, returning JSON response.private async handleSendInvoiceEmail(args: any) { const { id, mail_to, copy_to } = args; const result = await this.siigoClient.sendInvoiceByEmail(id, { mail_to, copy_to }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:431-443 (registration)Tool registration in ListTools response, including name, description, and input schema.{ name: 'siigo_send_invoice_email', description: 'Send invoice by email', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Invoice ID' }, mail_to: { type: 'string', description: 'Recipient email' }, copy_to: { type: 'string', description: 'CC emails (semicolon separated)' }, }, required: ['id', 'mail_to'], }, },
- src/index.ts:95-96 (handler)Dispatch case in CallToolRequest handler switch statement that routes to the specific tool handler.case 'siigo_send_invoice_email': return await this.handleSendInvoiceEmail(args);
- src/siigo-client.ts:41-59 (helper)Helper method used by all API calls, including sendInvoiceByEmail, to handle authentication and make HTTP requests.private async makeRequest<T>(method: string, endpoint: string, data?: any, params?: any): Promise<SiigoApiResponse<T>> { await this.authenticate(); try { const response: AxiosResponse<SiigoApiResponse<T>> = await this.httpClient.request({ method, url: endpoint, data, params, }); return response.data; } catch (error: any) { if (error.response?.data) { return error.response.data; } throw new Error(`API request failed: ${error.message}`); } }