siigo_get_customers
Retrieve customer lists from Siigo accounting software with pagination and filtering options to manage client data efficiently.
Instructions
Get list of customers from Siigo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number | |
| page_size | No | Number of items per page | |
| type | No | Customer type filter |
Implementation Reference
- src/siigo-client.ts:83-85 (handler)Core handler function that performs the API call to retrieve customers from Siigo (/v1/customers) using the makeRequest helper.async getCustomers(params?: { page?: number; page_size?: number; type?: string }): Promise<SiigoApiResponse<SiigoCustomer>> { return this.makeRequest<SiigoCustomer>('GET', '/v1/customers', undefined, params); }
- src/index.ts:842-852 (handler)MCP server wrapper handler that calls SiigoClient.getCustomers and formats the response.private async handleGetCustomers(args: any) { const result = await this.siigoClient.getCustomers(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:274-285 (schema)Tool schema definition including input parameters for pagination and filtering.{ name: 'siigo_get_customers', description: 'Get list of customers from Siigo', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, page_size: { type: 'number', description: 'Number of items per page' }, type: { type: 'string', description: 'Customer type filter' }, }, }, },
- src/index.ts:73-74 (registration)Dispatch case in the main CallToolRequestSchema handler that routes to the tool handler.case 'siigo_get_customers': return await this.handleGetCustomers(args);
- src/siigo-client.ts:41-59 (helper)Helper method that handles authentication, makes the Axios request to Siigo API, and processes responses/errors.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}`); } }