Skip to main content
Glama
bunkerapps

Superprecio MCP Server

by bunkerapps

get_my_alerts

Retrieve and monitor active price alerts to track current prices versus target prices, identify triggered deals, and manage your product watchlist for supermarket shopping in Argentina.

Instructions

Get all your active price alerts with their current status.

View all products you're monitoring and see:

  • Current prices vs. target prices

  • Which alerts have been triggered

  • How close you are to your target price

  • Last time prices were checked

Perfect for:

  • Reviewing all your alerts

  • Finding triggered alerts (good deals!)

  • Managing your watchlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNoOptional: Filter alerts by user ID
isActiveNoOptional: Filter by active/inactive alerts (default: show all)

Implementation Reference

  • The main handler function that executes the tool logic: fetches price alerts via API client, handles errors, formats a detailed summary with alert statuses, triggered counts, and returns formatted text content including JSON data.
    export async function executeGetMyAlerts( client: SuperPrecioApiClient, args: { userId?: number; isActive?: boolean } ) { const response = await client.getPriceAlerts(args); if (!response.success) { return { content: [ { type: 'text', text: `Failed to get price alerts: ${response.message || 'Unknown error'}`, }, ], isError: true, }; } const alerts = response.data; const count = response.count || 0; if (count === 0) { return { content: [ { type: 'text', text: ` No price alerts found. Create your first alert with set_price_alert! Example: Alert me when Coca Cola drops below $800 `, }, ], }; } const triggeredCount = alerts.filter((a: any) => a.currentPrice && a.currentPrice <= a.targetPrice).length; const summary = ` πŸ”” Your Price Alerts (${count} total) ${triggeredCount > 0 ? `πŸŽ‰ ${triggeredCount} ALERT${triggeredCount === 1 ? '' : 'S'} TRIGGERED!` : ''} ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ${alerts .map((alert: any, i: number) => { const isTriggered = alert.currentPrice && alert.currentPrice <= alert.targetPrice; const status = isTriggered ? 'πŸŽ‰ TRIGGERED!' : alert.currentPrice ? 'πŸ” Monitoring' : '⏳ Pending check'; const priceDiff = alert.currentPrice ? (alert.currentPrice - alert.targetPrice) : null; return ` ${i + 1}. ${alert.productName} (ID: ${alert.id}) ${status} 🎯 Target: $${alert.targetPrice.toLocaleString('es-AR')} ${alert.currentPrice ? `πŸ’΅ Current: $${alert.currentPrice.toLocaleString('es-AR')}${priceDiff !== null ? ` (${priceDiff >= 0 ? '+' : ''}$${priceDiff.toFixed(2)})` : ''}` : 'πŸ’΅ Current: Not checked yet'} ${alert.barcode ? `🏷️ Barcode: ${alert.barcode}` : ''} ${alert.notifyEnabled ? 'πŸ””' : 'πŸ”•'} Notifications ${alert.isActive ? 'βœ…' : '⏸️'} ${alert.isActive ? 'Active' : 'Paused'} ${alert.lastCheckedAt ? `πŸ“… Last checked: ${new Date(alert.lastCheckedAt).toLocaleDateString('es-AR')}` : ''} `; }) .join('\n')} Actions you can take: - Use check_alert_status to update current prices - Use remove_price_alert to delete an alert ${triggeredCount > 0 ? '\nπŸ›’ Good news! You have triggered alerts - great time to shop!' : ''} `; return { content: [ { type: 'text', text: summary, }, { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
  • Tool schema definition including name 'get_my_alerts', detailed description, and inputSchema with optional parameters for filtering alerts by userId and isActive status.
    export const getMyAlertsTool = { name: 'get_my_alerts', description: `Get all your active price alerts with their current status. View all products you're monitoring and see: - Current prices vs. target prices - Which alerts have been triggered - How close you are to your target price - Last time prices were checked Perfect for: - Reviewing all your alerts - Finding triggered alerts (good deals!) - Managing your watchlist`, inputSchema: { type: 'object', properties: { userId: { type: 'number', description: 'Optional: Filter alerts by user ID', }, isActive: { type: 'boolean', description: 'Optional: Filter by active/inactive alerts (default: show all)', }, }, }, };
  • src/index.ts:89-116 (registration)
    Registration of the tool in the MCP server's listTools handler, where getMyAlertsTool is included in the array of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ // V1 Tools searchProductsTool, searchByCodeTool, comparePriceTool, getBestDealsTool, sendNotificationTool, subscribeDeviceTool, // V2 Tools - Shopping Lists createShoppingListTool, addItemsToListTool, getShoppingListsTool, optimizeShoppingListTool, removeShoppingListTool, // V2 Tools - Price Alerts setPriceAlertTool, getMyAlertsTool, removePriceAlertTool, // V2 Tools - Location findNearbySupermarketsTool, ], }; });
  • src/index.ts:163-164 (registration)
    Dispatch/execution routing in the main CallToolRequestSchema handler that maps 'get_my_alerts' to the executeGetMyAlerts function.
    case 'get_my_alerts': return await executeGetMyAlerts(apiClient, args as any);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bunkerapps/superprecio_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server