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);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what information is returned (current prices, target prices, triggered status, proximity to target, last check time), which is helpful. However, it lacks details on permissions, rate limits, pagination, or error handling, leaving gaps for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by bullet points for details and a 'Perfect for' section for usage context. Every sentence adds value without repetition, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description does a good job explaining what the tool returns (e.g., current vs. target prices, triggered alerts). However, it could be more complete by specifying return format or data structure, especially since there's no output schema to rely on.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the baseline is 3. The description adds value by implying default behavior ('Get all your active price alerts') and context for filtering, such as focusing on 'active' alerts and 'your' data, which complements the schema's optional parameters without redundancy.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get all your active price alerts') and resource ('price alerts with their current status'), distinguishing it from siblings like 'set_price_alert' or 'remove_price_alert'. It explicitly defines the scope as 'your' alerts, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('Perfect for: Reviewing all your alerts, Finding triggered alerts, Managing your watchlist'), which helps differentiate it from tools like 'get_best_deals' or 'search_products'. However, it does not explicitly state when NOT to use it or name specific alternatives for overlapping functions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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