siigo_update_product
Modify existing product information in Siigo accounting software by providing the product ID and updated data fields.
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 tool handler: Performs the actual API call to update a product in Siigo via PUT /v1/products/{id}.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 handler wrapper: Receives tool arguments, calls SiigoClient.updateProduct, and returns formatted 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/index.ts:249-260 (registration)Tool registration: Defines the tool name, description, and input schema in the MCP server's getTools() method.{ 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/types.ts:59-92 (schema)TypeScript interface defining the structure of a SiigoProduct, used for input validation and API payloads.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:67-68 (handler)Switch case dispatcher in MCP CallToolRequest handler that routes to handleUpdateProduct.case 'siigo_update_product': return await this.handleUpdateProduct(args);