siigo_update_purchase
Modify existing purchase records in Siigo accounting software by providing the purchase ID and updated data to ensure accurate financial tracking.
Instructions
Update an existing purchase
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Purchase ID | |
| purchase | Yes | Purchase data to update |
Implementation Reference
- src/siigo-client.ts:167-169 (handler)Core handler implementation: performs PUT request to Siigo API endpoint /v1/purchases/{id} to update the purchase.async updatePurchase(id: string, purchase: any): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('PUT', `/v1/purchases/${id}`, purchase); }
- src/index.ts:1021-1024 (handler)MCP server wrapper handler that calls the SiigoClient updatePurchase and formats the response.private async handleUpdatePurchase(args: any) { const result = await this.siigoClient.updatePurchase(args.id, args.purchase); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:549-560 (schema)Tool schema definition including input schema for validating arguments: requires id and purchase object.{ name: 'siigo_update_purchase', description: 'Update an existing purchase', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Purchase ID' }, purchase: { type: 'object', description: 'Purchase data to update' }, }, required: ['id', 'purchase'], }, },
- src/index.ts:121-122 (registration)Tool dispatch registration in the switch statement for CallToolRequest handler.case 'siigo_update_purchase': return await this.handleUpdatePurchase(args);