rr_get_sync_status
Retrieve recent synchronization history for multi-channel inventory data to monitor stockout risks and manage purchase orders across Shopify and Amazon stores.
Instructions
Get recent sync run history
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connector_type | No | ||
| store_id | No | ||
| limit | No |
Implementation Reference
- src/index.ts:86-100 (handler)The CallToolRequestSchema handler in src/index.ts acts as a central dispatcher that calls the 'callApi' helper function, which in turn performs the actual remote request for the 'rr_get_sync_status' tool.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await callApi(name, (args as Record<string, unknown>) || {}); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true, }; } }); - src/index.ts:32-32 (registration)The tool 'rr_get_sync_status' is registered in the TOOLS array in src/index.ts.
{ name: 'rr_get_sync_status', description: 'Get recent sync run history', inputSchema: { type: 'object' as const, properties: { connector_type: { type: 'string' }, store_id: { type: 'string' }, limit: { type: 'number' } } } }, - src/index.ts:57-74 (helper)The 'callApi' function is the helper responsible for executing the tool logic by sending a POST request to the remote ReplenishRadar 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; }