get_stock_adjustment
Retrieve detailed information about specific inventory stock adjustments including related entities to track and analyze inventory changes.
Instructions
Get details of a specific stock adjustment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Related entities to include | |
| stockAdjustmentId | Yes | The stock adjustment ID |
Implementation Reference
- index.js:262-282 (registration)Registers the MCP tool 'get_stock_adjustment' with input schema (stockAdjustmentId, optional include) and a thin async handler that calls inventoryHandlers.getStockAdjustmentserver.registerTool( 'get_stock_adjustment', { description: 'Get details of a specific stock adjustment', inputSchema: { stockAdjustmentId: z.string().describe('The stock adjustment ID'), include: z.string().optional().describe('Related entities to include') } }, async (args) => { const result = await inventoryHandlers.getStockAdjustment(inflowClient, args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } );
- src/handlers/inventory-handlers.js:38-47 (handler)Main handler function for get_stock_adjustment: validates stockAdjustmentId and delegates to InflowClientasync getStockAdjustment(client, args) { if (!args.stockAdjustmentId) { return { success: false, error: 'stockAdjustmentId is required' }; } return await client.getStockAdjustment(args.stockAdjustmentId, args.include); },
- src/inflow-client.js:181-195 (helper)InflowClient helper method that makes the actual API GET request for stock adjustment detailsasync getStockAdjustment(stockAdjustmentId, include = null) { try { const params = include ? `?include=${include}` : ''; const response = await this.client.get( `/${this.config.companyId}/stock-adjustments/${stockAdjustmentId}${params}` ); return { success: true, data: response.data }; } catch (error) { return this._handleError(error, 'getStockAdjustment'); } }