Skip to main content
Glama
bunkerapps

Superprecio MCP Server

by bunkerapps

get_best_deals

Find supermarket deals and discounts by product category to help budget shoppers discover sale items and discount opportunities across multiple stores.

Instructions

Find the best deals and discounts currently available in supermarkets.

This tool helps you discover:

  • Products on sale

  • Best price-to-value items

  • Popular deals

  • Discount opportunities

Great for budget shopping and finding savings across all stores.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesProduct category or type to find deals for (e.g., "lácteos", "cereales", "bebidas")
maxResultsNoNumber of deals per supermarket (default: 10)

Implementation Reference

  • The executeGetBestDeals function is the core handler for the 'get_best_deals' tool. It queries the SuperPrecio API for products in a given category sorted by top sales, calculates discounts, sorts deals by discount percentage, generates a formatted text summary, and returns both text and JSON content.
    export async function executeGetBestDeals(
      client: SuperPrecioApiClient,
      args: { category: string; maxResults?: number }
    ) {
      if (!args) {
        throw new Error('Missing required arguments');
      }
    
      const { category, maxResults = 10 } = args;
    
      // Search with TopSale sorting to get best deals
      const response = await client.searchProducts({
        search: category,
        maxResults,
        order: 'OrderByTopSaleDESC',
      });
    
      const deals: Array<{
        supermarket: string;
        logo: string;
        product: string;
        price: number;
        discount?: number;
        link: string;
        image: string;
      }> = [];
    
      response.allData.forEach((marketProducts, idx) => {
        const market = response.markets[idx];
        if (marketProducts && marketProducts.length > 0) {
          marketProducts.forEach((product) => {
            const discount = product.listPrice
              ? ((product.listPrice - product.price) / product.listPrice) * 100
              : undefined;
    
            deals.push({
              supermarket: market.name,
              logo: market.logo,
              product: product.desc,
              price: product.price,
              discount: discount ? parseFloat(discount.toFixed(1)) : undefined,
              link: product.link,
              image: product.img,
            });
          });
        }
      });
    
      // Sort by discount percentage if available
      const dealsWithDiscount = deals.filter((d) => d.discount !== undefined);
      const dealsWithoutDiscount = deals.filter((d) => d.discount === undefined);
    
      const sortedDeals = [
        ...dealsWithDiscount.sort((a, b) => (b.discount || 0) - (a.discount || 0)),
        ...dealsWithoutDiscount,
      ];
    
      const summary = `
    Best Deals in "${category}"
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
    Found ${deals.length} products across ${response.columns} supermarkets
    
    ${sortedDeals
      .slice(0, 15)
      .map(
        (deal, i) =>
          `${i + 1}. ${deal.product}
       🏪 ${deal.supermarket}
       💵 $${deal.price.toLocaleString('es-AR')}${deal.discount ? ` (${deal.discount}% OFF)` : ''}
       🔗 ${deal.link}`
      )
      .join('\n\n')}
    `;
    
      return {
        content: [
          {
            type: 'text',
            text: summary,
          },
          {
            type: 'text',
            text: JSON.stringify({ category, totalDeals: deals.length, deals: sortedDeals }, null, 2),
          },
        ],
      };
    }
  • Defines the tool schema for 'get_best_deals', including name, description, and inputSchema with required 'category' parameter and optional 'maxResults'.
    export const getBestDealsTool = {
      name: 'get_best_deals',
      description: `Find the best deals and discounts currently available in supermarkets.
    
    This tool helps you discover:
    - Products on sale
    - Best price-to-value items
    - Popular deals
    - Discount opportunities
    
    Great for budget shopping and finding savings across all stores.`,
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Product category or type to find deals for (e.g., "lácteos", "cereales", "bebidas")',
          },
          maxResults: {
            type: 'number',
            description: 'Number of deals per supermarket (default: 10)',
            minimum: 1,
            maximum: 30,
            default: 10,
          },
        },
        required: ['category'],
      },
    };
  • src/index.ts:134-135 (registration)
    In the CallToolRequestSchema handler's switch statement, registers the execution dispatch for 'get_best_deals' by calling executeGetBestDeals.
    case 'get_best_deals':
      return await executeGetBestDeals(apiClient, args as any);
  • src/index.ts:96-96 (registration)
    Includes getBestDealsTool in the array of tools returned by the ListToolsRequestSchema handler.
    getBestDealsTool,
  • src/index.ts:32-32 (registration)
    Imports the getBestDealsTool schema and executeGetBestDeals handler from the tool module.
    import { getBestDealsTool, executeGetBestDeals } from './tools/getBestDeals.js';
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions discovering deals but fails to disclose key behavioral traits such as whether results are real-time, how deals are ranked, if authentication is needed, or any rate limits. This is a significant gap for a tool with potential complexity in data sourcing and presentation.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, starting with a clear purpose statement followed by bullet points for specific features and a concluding use case. It avoids redundancy, though the bullet points could be slightly more concise, and every sentence contributes to understanding the tool's value.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It does not explain what the tool returns (e.g., deal details, supermarket names, prices), how results are structured, or any limitations (e.g., geographic scope, data freshness). For a deal-finding tool with potential complexity, this leaves significant gaps for an AI agent to use it effectively.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters ('category' and 'maxResults') with clear descriptions and constraints. The description adds no additional parameter semantics beyond what the schema provides, such as examples of categories or context for maxResults, meeting the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose as finding best deals and discounts in supermarkets, specifying resources like products on sale and best price-to-value items. It distinguishes from siblings like 'compare_prices' or 'search_products' by focusing on curated deals rather than general price comparison or product search, though it could be more explicit about the distinction.

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

Usage Guidelines3/5

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

The description implies usage for budget shopping and finding savings, suggesting when to use it (e.g., for deals rather than general product lookup). However, it lacks explicit guidance on when to use this versus alternatives like 'compare_prices' or 'search_products', leaving some ambiguity in tool selection.

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