siigo_update_product
Modify existing product information in Siigo accounting software by providing the product ID and updated data fields to maintain accurate inventory and financial records.
Instructions
Update an existing product
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Product ID | |
| product | Yes | Product data to update |
Implementation Reference
- src/siigo-client.ts:74-76 (handler)Core handler function that performs the PUT request to Siigo API to update a product.async updateProduct(id: string, product: Partial<SiigoProduct>): Promise<SiigoApiResponse<SiigoProduct>> { return this.makeRequest<SiigoProduct>('PUT', `/v1/products/${id}`, product); }
- src/index.ts:818-828 (handler)MCP server wrapper handler that delegates to SiigoClient and formats response.private async handleUpdateProduct(args: any) { const result = await this.siigoClient.updateProduct(args.id, args.product); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/types.ts:59-92 (schema)TypeScript interface defining the SiigoProduct structure used for update.export interface SiigoProduct { id?: string; code: string; name: string; account_group: number; type?: 'Product' | 'Service' | 'ConsumerGood'; stock_control?: boolean; active?: boolean; tax_classification?: 'Taxed' | 'Exempt' | 'Excluded'; tax_included?: boolean; tax_consumption_value?: number; taxes?: Array<{ id: number; milliliters?: number; rate?: number; }>; prices?: Array<{ currency_code: string; price_list: Array<{ position: number; value: number; }>; }>; unit?: string; unit_label?: string; reference?: string; description?: string; additional_fields?: { barcode?: string; brand?: string; tariff?: string; model?: string; }; }
- src/index.ts:249-260 (registration)Tool registration in getTools() including name, description, and input schema.{ name: 'siigo_update_product', description: 'Update an existing product', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Product ID' }, product: { type: 'object', description: 'Product data to update' }, }, required: ['id', 'product'], }, },
- src/siigo-client.ts:41-59 (helper)Helper method used by all API calls, including authentication and request handling.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}`); } }