list_stock_adjustments
Retrieve inventory stock adjustments with filtering options to track and analyze inventory changes, modifications, and corrections in your ingredient management system.
Instructions
List stock adjustments with optional filters
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adjustmentNumber | No | Filter by adjustment number | |
| include | No | Related entities to include | |
| limit | No | Maximum number of results (default: 50) |
Implementation Reference
- src/handlers/inventory-handlers.js:20-28 (handler)Handler function that processes input arguments, builds query options, and delegates to the InflowClient's listStockAdjustments method to fetch stock adjustments.async listStockAdjustments(client, args) { const options = { adjustmentNumber: args.adjustmentNumber, include: args.include, limit: args.limit || 50 }; return await client.listStockAdjustments(options); },
- index.js:238-258 (registration)MCP tool registration for 'list_stock_adjustments', including input schema definition using Zod and a thin async handler that calls the inventory handler and formats the response.server.registerTool( 'list_stock_adjustments', { description: 'List stock adjustments with optional filters', inputSchema: { adjustmentNumber: z.string().optional().describe('Filter by adjustment number'), include: z.string().optional().describe('Related entities to include'), limit: z.number().optional().describe('Maximum number of results (default: 50)') } }, async (args) => { const result = await inventoryHandlers.listStockAdjustments(inflowClient, args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/inflow-client.js:154-173 (helper)Core API client method that performs the HTTP GET request to the Inflow Inventory API endpoint for listing stock adjustments, constructs query parameters, handles the response, and manages errors.async listStockAdjustments(options = {}) { try { const params = new URLSearchParams(); if (options.adjustmentNumber) params.append('filter[adjustmentNumber]', options.adjustmentNumber); if (options.include) params.append('include', options.include); if (options.limit) params.append('limit', options.limit.toString()); const response = await this.client.get( `/${this.config.companyId}/stock-adjustments?${params.toString()}` ); return { success: true, data: response.data }; } catch (error) { return this._handleError(error, 'listStockAdjustments'); } }