Skip to main content
Glama
bunkerapps

Superprecio MCP Server

by bunkerapps

create_shopping_list

Create shopping lists to organize purchases and compare supermarket prices in Argentina. Start with an empty list or add items immediately, then optimize where to buy for the best deals.

Instructions

Create a new shopping list to organize your purchases.

You can create an empty list and add items later, or create a list with items right away. This is useful for planning your shopping and then optimizing which supermarket to buy from.

Features:

  • Create named lists (e.g., "Weekly groceries", "Party supplies")

  • Add optional description

  • Include initial items with quantities

  • Link to user ID (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the shopping list (e.g., "Weekly groceries", "Monthly shopping")
descriptionNoOptional description of what this list is for
userIdNoOptional user ID to associate this list with
itemsNoOptional initial items to add to the list

Implementation Reference

  • The executeCreateShoppingList function is the main handler that executes the tool's logic: validates inputs implicitly via types, calls the API client's createShoppingList method, handles success/error responses, formats a user-friendly summary, and returns structured content.
    export async function executeCreateShoppingList(
      client: SuperPrecioApiClient,
      args: {
        name: string;
        description?: string;
        userId?: number;
        items?: Array<{
          productName: string;
          barcode?: string;
          quantity?: number;
          notes?: string;
        }>;
      }
    ) {
      const response = await client.createShoppingList(args);
    
      if (!response.success) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to create shopping list: ${response.message || 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    
      const list = response.data;
      const itemCount = list.items?.length || 0;
    
      const summary = `
    ✅ Shopping List Created Successfully!
    
    📝 Name: ${list.name}
    ${list.description ? `📄 Description: ${list.description}` : ''}
    🆔 List ID: ${list.id}
    🛒 Items: ${itemCount} ${itemCount === 1 ? 'item' : 'items'}
    📅 Created: ${new Date(list.createdAt).toLocaleDateString('es-AR')}
    
    ${itemCount > 0 ? `
    Items in list:
    ${list.items.map((item: any, i: number) => `${i + 1}. ${item.productName} (x${item.quantity})`).join('\n')}
    ` : 'No items yet. Use add_items_to_list to add products.'}
    
    Next steps:
    - Use add_items_to_list to add more products
    - Use optimize_shopping_list to find the best supermarket for this list
    `;
    
      return {
        content: [
          {
            type: 'text',
            text: summary,
          },
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • The createShoppingListTool object defines the tool schema, including name 'create_shopping_list', detailed description, and inputSchema with properties for name (required), description, userId, and items array (with productName required per item). This is used for MCP tool listing and input validation.
    export const createShoppingListTool = {
      name: 'create_shopping_list',
      description: `Create a new shopping list to organize your purchases.
    
    You can create an empty list and add items later, or create a list with items right away.
    This is useful for planning your shopping and then optimizing which supermarket to buy from.
    
    Features:
    - Create named lists (e.g., "Weekly groceries", "Party supplies")
    - Add optional description
    - Include initial items with quantities
    - Link to user ID (optional)`,
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the shopping list (e.g., "Weekly groceries", "Monthly shopping")',
          },
          description: {
            type: 'string',
            description: 'Optional description of what this list is for',
          },
          userId: {
            type: 'number',
            description: 'Optional user ID to associate this list with',
          },
          items: {
            type: 'array',
            description: 'Optional initial items to add to the list',
            items: {
              type: 'object',
              properties: {
                productName: {
                  type: 'string',
                  description: 'Product name (e.g., "Leche descremada", "Arroz integral")',
                },
                barcode: {
                  type: 'string',
                  description: 'Optional product barcode/EAN for exact matching',
                },
                quantity: {
                  type: 'number',
                  description: 'Quantity needed (default: 1)',
                  minimum: 1,
                },
                notes: {
                  type: 'string',
                  description: 'Optional notes (e.g., "1 liter", "2kg bag")',
                },
              },
              required: ['productName'],
            },
          },
        },
        required: ['name'],
      },
    };
  • src/index.ts:89-116 (registration)
    The tool is registered in the MCP server's ListToolsRequestSchema handler by including createShoppingListTool in the returned tools array (specifically at line 101).
    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:119-187 (registration)
    The tool execution handler is registered in the MCP server's CallToolRequestSchema via a switch statement that dispatches 'create_shopping_list' calls to executeCreateShoppingList (lines 144-145).
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        switch (name) {
          // V1 Tools
          case 'search_products':
            return await executeSearchProducts(apiClient, args as any);
    
          case 'search_by_code':
            return await executeSearchByCode(apiClient, args as any);
    
          case 'compare_prices':
            return await executeComparePrice(apiClient, args as any);
    
          case 'get_best_deals':
            return await executeGetBestDeals(apiClient, args as any);
    
          case 'send_notification':
            return await executeSendNotification(apiClient, args as any);
    
          case 'subscribe_device':
            return await executeSubscribeDevice(apiClient, args as any);
    
          // V2 Tools - Shopping Lists
          case 'create_shopping_list':
            return await executeCreateShoppingList(apiClient, args as any);
    
          case 'add_items_to_list':
            return await executeAddItemsToList(apiClient, args as any);
    
          case 'get_shopping_lists':
            return await executeGetShoppingLists(apiClient, args as any);
    
          case 'optimize_shopping_list':
            return await executeOptimizeShoppingList(apiClient, args as any);
    
          case 'remove_shopping_list':
            return await executeRemoveShoppingList(apiClient, args as any);
    
          // V2 Tools - Price Alerts
          case 'set_price_alert':
            return await executeSetPriceAlert(apiClient, args as any);
    
          case 'get_my_alerts':
            return await executeGetMyAlerts(apiClient, args as any);
    
          case 'remove_price_alert':
            return await executeRemovePriceAlert(apiClient, args as any);
    
          // V2 Tools - Location
          case 'find_nearby_supermarkets':
            return await executeFindNearbySupermarkets(apiClient, args as any);
    
          default:
            throw new Error(`Unknown tool: ${name}`);
        }
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error executing tool ${name}: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    });
Behavior2/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. While it mentions the tool creates lists and includes features like linking to user IDs, it lacks critical behavioral details such as permission requirements, whether creation is idempotent, error conditions, or what the response contains. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 appropriately sized, starting with a clear purpose statement followed by usage flexibility and a bulleted feature list. While the bullet points are helpful, the second sentence about supermarket optimization feels slightly tangential and could be more tightly integrated with the core functionality.

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

Completeness3/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 (creation with optional nested items), no annotations, and no output schema, the description is partially complete. It covers the basic purpose and parameters but lacks behavioral transparency and output details. For a creation tool, it should ideally mention what happens on success (e.g., returns list ID) or failure, making it adequate but with clear 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 description adds some semantic context beyond the schema, such as explaining the purpose ('organize your purchases') and listing features that map to parameters (e.g., 'include initial items with quantities'). However, with 100% schema description coverage, the schema already documents all parameters thoroughly, so the description provides only marginal additional value without explaining parameter interactions or constraints.

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 ('create a new shopping list') and resource ('shopping list'), distinguishing it from siblings like 'get_shopping_lists' (read) and 'remove_shopping_list' (delete). It explicitly mentions creating both empty lists and lists with initial items, making the scope 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 on when to use this tool ('useful for planning your shopping'), including the flexibility to create empty lists or lists with items. However, it doesn't explicitly state when NOT to use it or mention alternatives like 'add_items_to_list' for adding items to existing lists, which would be helpful for sibling 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