Skip to main content
Glama
bunkerapps

Superprecio MCP Server

by bunkerapps

search_products

Search for products across Argentina supermarkets to compare prices and find deals. This tool searches multiple stores simultaneously, handling Spanish characters and partial matches, returning prices, availability, and direct links.

Instructions

Search for products by name or description across all Argentina supermarkets.

This tool searches multiple supermarkets simultaneously and returns price comparisons. It's perfect for finding the best deals and comparing prices across different stores.

The search is smart and handles:

  • Spanish characters and accents (café, leche, etc.)

  • Partial matches

  • Common product names

  • Brand names

Results include:

  • Product images

  • Prices

  • Direct links to products

  • Supermarket information

  • Availability across stores

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesProduct name or description to search for (e.g., "leche descremada", "arroz integral", "coca cola")
maxResultsNoMaximum number of results per supermarket (1-50, default: 9)
sortByNoHow to sort the resultsOrderByTopSaleDESC

Implementation Reference

  • Defines the tool schema for 'search_products' including name, description, and inputSchema for MCP tool listing.
    export const searchProductsTool = {
      name: 'search_products',
      description: `Search for products by name or description across all Argentina supermarkets.
    
    This tool searches multiple supermarkets simultaneously and returns price comparisons.
    It's perfect for finding the best deals and comparing prices across different stores.
    
    The search is smart and handles:
    - Spanish characters and accents (café, leche, etc.)
    - Partial matches
    - Common product names
    - Brand names
    
    Results include:
    - Product images
    - Prices
    - Direct links to products
    - Supermarket information
    - Availability across stores`,
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Product name or description to search for (e.g., "leche descremada", "arroz integral", "coca cola")',
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results per supermarket (1-50, default: 9)',
            minimum: 1,
            maximum: 50,
            default: 9,
          },
          sortBy: {
            type: 'string',
            description: 'How to sort the results',
            enum: ['OrderByTopSaleDESC', 'OrderByPriceASC', 'OrderByPriceDESC'],
            default: 'OrderByTopSaleDESC',
          },
        },
        required: ['query'],
      },
    };
  • Executes the search_products tool: validates args, calls SuperPrecioApiClient.searchProducts, formats results, and returns MCP content.
    export async function executeSearchProducts(
      client: SuperPrecioApiClient,
      args: {
        query: string;
        maxResults?: number;
        sortBy?: 'OrderByTopSaleDESC' | 'OrderByPriceASC' | 'OrderByPriceDESC';
      }
    ) {
      if (!args) {
        throw new Error('Missing required arguments');
      }
    
      if (!args.query) {
        throw new Error('Missing required parameter: query');
      }
    
      if (!client) {
        throw new Error('API client is not initialized');
      }
    
      const { query, maxResults = 9, sortBy = 'OrderByTopSaleDESC' } = args;
    
      const response = await client.searchProducts({
        search: query,
        maxResults,
        order: sortBy,
      });
    
      // Format response for better readability
      const results = {
        summary: {
          query: response.searched.search,
          totalSupermarkets: response.columns,
          totalProducts: response.allData.reduce((sum, market) => sum + market.length, 0),
        },
        supermarkets: response.markets.map((market) => ({
          name: market.name,
          logo: market.logo,
        })),
        products: response.allData.map((marketProducts, idx) => ({
          supermarket: response.markets[idx] ? response.markets[idx].name : 'Unknown',
          logo: response.markets[idx] ? response.markets[idx].logo : '',
          products: marketProducts.map((product) => ({
            name: product.desc,
            price: product.price,
            image: product.img,
            link: product.link,
            code: product.code,
            barcode: product.barcode,
          })),
        })),
      };
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(results, null, 2),
          },
        ],
      };
    }
  • src/index.ts:89-116 (registration)
    Registers the searchProductsTool (line 93) in the MCP server's listTools handler, making it discoverable.
    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:125-126 (registration)
    Dispatches execution of search_products tool in the MCP server's CallToolRequestSchema handler.
    case 'search_products':
      return await executeSearchProducts(apiClient, args as any);
Behavior4/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 effectively describes key traits: it searches multiple supermarkets simultaneously, handles Spanish characters/accents, partial matches, and common/brand names, and returns structured results (images, prices, links, etc.). It lacks details on rate limits, authentication needs, or error handling, but covers core functionality well.

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 well-structured and front-loaded with the core purpose, followed by details on functionality and results. It uses bullet points for clarity, but could be slightly more concise by integrating some points (e.g., combining search handling features into a single sentence). Overall, it avoids redundancy and each sentence adds value.

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 the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, usage, behavioral traits, and result format. However, it lacks output schema details (e.g., structure of returned data) and does not mention potential limitations like API errors or pagination, leaving minor gaps.

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?

The schema description coverage is 100%, so the schema already documents all parameters (query, maxResults, sortBy) thoroughly. The description adds no additional parameter semantics beyond what the schema provides, such as examples or edge cases, 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.

Purpose5/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 with specific verbs ('search for products') and resources ('across all Argentina supermarkets'), distinguishing it from siblings like 'search_by_code' (which searches by code) and 'compare_prices' (which may compare specific products). It explicitly mentions searching by name or description and returning price comparisons.

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: for finding best deals and comparing prices across stores. However, it does not explicitly state when not to use it or name alternatives (e.g., 'search_by_code' for barcode searches or 'get_best_deals' for curated deals), leaving some ambiguity about sibling tool differentiation.

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