siigo_get_products
Retrieve product listings from Siigo accounting software. Use this tool to access product data with pagination controls for efficient management.
Instructions
Get list of products from Siigo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number | |
| page_size | No | Number of items per page |
Implementation Reference
- src/index.ts:198-208 (registration)Tool registration in getTools() method, defining name, description, and input schema for pagination parameters.{ name: 'siigo_get_products', description: 'Get list of products from Siigo', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, page_size: { type: 'number', description: 'Number of items per page' }, }, }, },
- src/index.ts:782-792 (handler)MCP server handler wrapper that calls SiigoClient.getProducts with arguments and formats the result as JSON text content.private async handleGetProducts(args: any) { const result = await this.siigoClient.getProducts(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/siigo-client.ts:62-64 (handler)Core product listing handler in SiigoClient that performs authenticated GET request to Siigo API /v1/products endpoint with optional pagination.async getProducts(params?: { page?: number; page_size?: number }): Promise<SiigoApiResponse<SiigoProduct>> { return this.makeRequest<SiigoProduct>('GET', '/v1/products', undefined, params); }
- src/types.ts:59-92 (schema)TypeScript interface defining the structure of SiigoProduct used for typing the API response.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/siigo-client.ts:41-58 (helper)Utility method handling authentication, HTTP requests to Siigo API, and error handling, used by all tool implementations.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}`); }