siigo_update_purchase
Modify existing purchase records in Siigo accounting software by providing the purchase ID and updated data fields.
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/index.ts:1021-1024 (handler)MCP tool handler function that invokes SiigoClient.updatePurchase and formats the response as text content.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)Input schema for the siigo_update_purchase tool, defining required '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)Registration of the tool in the switch statement for dispatching CallToolRequests.case 'siigo_update_purchase': return await this.handleUpdatePurchase(args);
- src/siigo-client.ts:167-169 (helper)Core implementation that performs the PUT request to Siigo API endpoint /v1/purchases/{id} using the generic makeRequest method.async updatePurchase(id: string, purchase: any): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('PUT', `/v1/purchases/${id}`, purchase); }