rr_get_top_sellers
Identify top-selling products by analyzing sales data to optimize inventory decisions for Shopify and Amazon sellers.
Instructions
Get top-selling SKUs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| limit | No | ||
| store_id | No |
Implementation Reference
- src/index.ts:39-39 (registration)Registration of rr_get_top_sellers tool.
{ name: 'rr_get_top_sellers', description: 'Get top-selling SKUs', inputSchema: { type: 'object' as const, properties: { days: { type: 'number', default: 30 }, limit: { type: 'number', default: 20 }, store_id: { type: 'string' } } } }, - src/index.ts:57-74 (handler)The generic callApi handler that executes the tool logic by delegating to the REST 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; }