get_ingredient
Retrieve detailed ingredient and product information including inventory data and images using product ID from the Inflow Inventory system.
Instructions
Get detailed information about a specific ingredient/product
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Related entities to include (e.g., "inventoryLines,defaultImage") | |
| productId | Yes | The product ID (UUID) |
Implementation Reference
- index.js:85-105 (registration)Registration of the 'get_ingredient' tool, including input schema definition and execution wrapper that calls productHandlers.getProductserver.registerTool( 'get_ingredient', { description: 'Get detailed information about a specific ingredient/product', inputSchema: { productId: z.string().describe('The product ID (UUID)'), include: z.string().optional().describe('Related entities to include (e.g., "inventoryLines,defaultImage")') } }, async (args) => { const result = await productHandlers.getProduct(inflowClient, args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } );
- src/handlers/product-handlers.js:45-54 (handler)Handler function for get_ingredient tool: validates productId and delegates to InflowClient.getProductasync getProduct(client, args) { if (!args.productId) { return { success: false, error: 'productId is required' }; } return await client.getProduct(args.productId, args.include); },
- src/inflow-client.js:82-96 (handler)Core implementation of product retrieval: makes HTTP GET request to Inflow API endpoint /products/{productId} with optional includes and error handlingasync getProduct(productId, include = null) { try { const params = include ? `?include=${include}` : ''; const response = await this.client.get( `/${this.config.companyId}/products/${productId}${params}` ); return { success: true, data: response.data }; } catch (error) { return this._handleError(error, 'getProduct'); } }