rr_get_demand_forecast
Generate demand forecasts for inventory items to predict stock needs and prevent shortages, using SKU, item ID, time window, and store parameters.
Instructions
Get demand forecast stats for an item
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sku | No | ||
| item_id | No | ||
| window_days | No | ||
| store_id | No |
Implementation Reference
- src/index.ts:57-74 (handler)The generic handler `callApi` dispatches the tool name and input to the remote API.
async function callApi(toolName: string, input: Record<string, unknown>): Promise<unknown> { const resp = await fetch(`${BASE_URL}/api/mcp/call`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${API_KEY}`, }, body: JSON.stringify({ tool: toolName, input }), }); if (!resp.ok) { const errorBody = await resp.text(); throw new Error(`API error ${resp.status}: ${errorBody}`); } const data = await resp.json(); return data.result; } - src/index.ts:28-28 (registration)Registration of the 'rr_get_demand_forecast' tool and its input schema.
{ name: 'rr_get_demand_forecast', description: 'Get demand forecast stats for an item', inputSchema: { type: 'object' as const, properties: { sku: { type: 'string' }, item_id: { type: 'string' }, window_days: { type: 'number' }, store_id: { type: 'string' } } } },