siigo_update_customer
Modify existing customer information in the Siigo accounting system by providing the customer ID and updated data fields.
Instructions
Update an existing customer
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer | Yes | Customer data to update | |
| id | Yes | Customer ID |
Implementation Reference
- src/index.ts:878-888 (handler)MCP tool handler function that executes the tool logic by calling SiigoClient.updateCustomer and formatting the response as MCP content.private async handleUpdateCustomer(args: any) { const result = await this.siigoClient.updateCustomer(args.id, args.customer); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/siigo-client.ts:94-96 (handler)Core handler in SiigoClient that performs the actual API PUT request to update the customer in Siigo.async updateCustomer(id: string, customer: Partial<SiigoCustomer>): Promise<SiigoApiResponse<SiigoCustomer>> { return this.makeRequest<SiigoCustomer>('PUT', `/v1/customers/${id}`, customer);
- src/index.ts:336-347 (registration)Registration of the siigo_update_customer tool in the MCP server's getTools() method, defining name, description, and input schema.{ name: 'siigo_update_customer', description: 'Update an existing customer', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Customer ID' }, customer: { type: 'object', description: 'Customer data to update' }, }, required: ['id', 'customer'], }, },
- src/types.ts:15-57 (schema)TypeScript interface defining the structure of customer data used for update operations.export interface SiigoCustomer { id?: string; type?: 'Customer' | 'Supplier' | 'Other'; person_type: 'Person' | 'Company'; id_type: string; identification: string; check_digit?: string; name: string[]; commercial_name?: string; branch_office?: number; active?: boolean; vat_responsible?: boolean; fiscal_responsibilities?: Array<{ code: string }>; address: { address: string; city: { country_code: string; state_code: string; city_code: string; }; postal_code?: string; }; phones: Array<{ indicative?: string; number: string; extension?: string; }>; contacts: Array<{ first_name: string; last_name: string; email: string; phone?: { indicative?: string; number?: string; extension?: string; }; }>; comments?: string; related_users?: { seller_id?: number; collector_id?: number; }; }