Skip to main content
Glama
bunkerapps

Superprecio MCP Server

by bunkerapps

get_shopping_lists

Retrieve all active shopping lists with their items to view saved lists, find specific lists for optimization, or manage multiple lists, optionally filtered by user ID.

Instructions

Get all shopping lists, optionally filtered by user.

Returns a list of all active shopping lists with their items. Useful for:

  • Viewing all your saved lists

  • Finding a specific list to optimize

  • Managing multiple shopping lists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNoOptional: Filter lists by user ID

Implementation Reference

  • The handler function executeGetShoppingLists that performs the core logic: calls the API client to fetch shopping lists, handles errors, formats a user-friendly summary with list details, and returns structured content including JSON data.
    export async function executeGetShoppingLists(
      client: SuperPrecioApiClient,
      args: { userId?: number }
    ) {
      const response = await client.getShoppingLists(args);
    
      if (!response.success) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to get shopping lists: ${response.message || 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    
      const lists = response.data;
      const count = response.count || 0;
    
      if (count === 0) {
        return {
          content: [
            {
              type: 'text',
              text: `
    No shopping lists found.
    
    Create your first list with create_shopping_list!
    `,
            },
          ],
        };
      }
    
      const summary = `
    📋 Your Shopping Lists (${count} total)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
    ${lists
      .map((list: any, i: number) => {
        const itemCount = list.items?.length || 0;
        return `
    ${i + 1}. ${list.name} (ID: ${list.id})
       ${list.description ? `📄 ${list.description}` : ''}
       🛒 Items: ${itemCount}
       📅 Created: ${new Date(list.createdAt).toLocaleDateString('es-AR')}
       ${itemCount > 0 ? `   Products: ${list.items.slice(0, 3).map((item: any) => item.productName).join(', ')}${itemCount > 3 ? '...' : ''}` : ''}
    `;
      })
      .join('\n')}
    
    Actions you can take:
    - optimize_shopping_list - Find best supermarket for a list
    - add_items_to_list - Add more products
    - remove_shopping_list - Delete a list
    `;
    
      return {
        content: [
          {
            type: 'text',
            text: summary,
          },
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • Tool definition including name, description, and inputSchema for validation of parameters (userId optional number).
    export const getShoppingListsTool = {
      name: 'get_shopping_lists',
      description: `Get all shopping lists, optionally filtered by user.
    
    Returns a list of all active shopping lists with their items.
    Useful for:
    - Viewing all your saved lists
    - Finding a specific list to optimize
    - Managing multiple shopping lists`,
      inputSchema: {
        type: 'object',
        properties: {
          userId: {
            type: 'number',
            description: 'Optional: Filter lists by user ID',
          },
        },
      },
    };
  • src/index.ts:150-151 (registration)
    Switch case in the MCP server tool handler that routes 'get_shopping_lists' calls to the execute function.
    case 'get_shopping_lists':
      return await executeGetShoppingLists(apiClient, args as any);
  • src/index.ts:103-103 (registration)
    Inclusion of getShoppingListsTool in the list of tools returned by ListToolsRequestSchema.
    getShoppingListsTool,
  • API client method that makes the HTTP request to fetch shopping lists from the backend API, used by the tool handler.
    async getShoppingLists(params?: { userId?: number }): Promise<any> {
      try {
        const response = await this.client.get('/api/lists', { params });
        return response.data;
      } catch (error) {
        throw this.handleError(error);
      }
    }
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 of behavioral disclosure. It mentions that the tool 'Returns a list of all active shopping lists with their items,' which clarifies the output format and scope ('active'). However, it fails to disclose critical behavioral traits such as whether this is a read-only operation (implied but not stated), potential rate limits, authentication needs, or pagination handling. For a tool with zero annotation coverage, this is a significant gap, warranting a score of 2.

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: the first sentence states the core purpose, followed by output details and a 'Useful for' section. Each sentence adds value, such as clarifying the return format and use cases. However, the bullet points could be more concise (e.g., 'Finding a specific list to optimize' is somewhat verbose), and there's minor redundancy in emphasizing 'all' lists. Overall, it's efficient but not perfectly streamlined, earning a score of 4.

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 low complexity (1 optional parameter, no output schema, no annotations), the description is moderately complete. It covers the purpose, output format, and use cases, but lacks details on behavioral aspects like safety (read-only vs. mutation) or error handling. Without annotations or output schema, the description should do more to compensate, such as explicitly stating it's a read operation or mentioning any limitations. This results in a score of 3, as it's adequate but has clear gaps for a tool with no structured support.

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 input schema has 100% description coverage, with the parameter 'userId' documented as 'Optional: Filter lists by user ID.' The description adds value by reinforcing this optional filtering ('optionally filtered by user') and implying it returns 'all active shopping lists' when no filter is applied. However, it doesn't provide additional semantics beyond what the schema already covers, such as format details or examples. With high schema coverage, the baseline is 3, which is appropriate here.

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: 'Get all shopping lists, optionally filtered by user.' This specifies the verb ('Get') and resource ('shopping lists') with scope ('all'), and it distinguishes from siblings like 'create_shopping_list' or 'remove_shopping_list' by focusing on retrieval. However, it doesn't explicitly differentiate from potential list-viewing alternatives (e.g., 'get_my_alerts' might overlap in context), keeping it at 4 rather than 5.

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 provides implied usage through 'Useful for' bullet points (e.g., 'Viewing all your saved lists'), which suggests contexts like management or optimization. However, it lacks explicit guidance on when to use this tool versus alternatives like 'search_products' or 'get_est_deals' for related tasks, and it doesn't specify exclusions or prerequisites. This results in a score of 3 for implied but incomplete guidance.

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