rr_trigger_sync
Trigger inventory synchronization between Shopify or Amazon stores and ReplenishRadar to maintain accurate stock levels and prevent stockouts.
Instructions
Trigger an inventory sync
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connector_type | Yes | ||
| store_id | No |
Implementation Reference
- src/index.ts:45-45 (schema)The tool 'rr_trigger_sync' is registered in the TOOLS array with its input schema defined.
{ name: 'rr_trigger_sync', description: 'Trigger an inventory sync', inputSchema: { type: 'object' as const, properties: { connector_type: { type: 'string', enum: ['shopify', 'amazon'] }, store_id: { type: 'string' } }, required: ['connector_type'] } }, - src/index.ts:57-74 (handler)The 'callApi' function acts as the handler for all MCP tools, including 'rr_trigger_sync', by forwarding the tool name and arguments to a 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; }