Skip to main content
Glama
nicktcode

Swissgroceries MCP

get_promotions

List current promotional deals across Swiss grocery chains. Filter by chain, keyword, store, or days until expiry to discover discounts on specific products.

Instructions

List current promotional deals across configured Swiss grocery chains. Filter by chain, keyword, store ID, or how many days until the promotion expires. Returns promotion name, discount, validity dates, and applicable stores. Use for "what is on sale this week?", "any Migros deals on cheese?", or "promotions ending today".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainsNoLimit to specific chains. Omit to fetch promotions from all configured chains.
queryNoOptional keyword to filter promotions by product name, e.g. "Käse", "wine".
endingWithinDaysNoOnly return promotions ending within this many days (1–60). Useful for "ending soon" queries.
storeIdsNoRestrict to promotions valid at these store IDs (chain-specific). Obtain store IDs from find_stores.

Implementation Reference

  • Main handler: resolves adapters with 'promotions' capability, fetches promotions from each adapter, and returns flattened results.
    export async function getPromotionsHandler(
      registry: AdapterRegistry,
      input: GetPromotionsInput,
    ): Promise<NormalizedPromotion[]> {
      const adapters = registry.withCapability('promotions', input.chains);
      const lists = await Promise.all(
        adapters.map(async (a) => {
          const r = await a.getPromotions({
            query: input.query,
            endingWithinDays: input.endingWithinDays,
            storeIds: input.storeIds,
          });
          return r.ok ? r.data : [];
        }),
      );
      return lists.flat();
    }
  • Zod schema defining input: chains (optional enum array), query (optional string), endingWithinDays (optional 1-60 int), storeIds (optional string array).
    export const getPromotionsSchema = z.object({
      chains: z.array(z.enum(['migros', 'coop', 'aldi', 'denner', 'lidl', 'farmy', 'volgshop', 'ottos']))
        .optional()
        .describe('Limit to specific chains. Omit to fetch promotions from all configured chains.'),
      query: z.string()
        .optional()
        .describe('Optional keyword to filter promotions by product name, e.g. "Käse", "wine".'),
      endingWithinDays: z.number().int().positive().max(60)
        .optional()
        .describe('Only return promotions ending within this many days (1–60). Useful for "ending soon" queries.'),
      storeIds: z.array(z.string())
        .optional()
        .describe('Restrict to promotions valid at these store IDs (chain-specific). Obtain store IDs from find_stores.'),
    }).describe('List current promotional deals across Swiss grocery chains. Supports keyword search and filtering by chain, store, or expiry window. Use for "what is on sale?" or "any deals on pasta this week?" queries.');
  • src/index.ts:83-93 (registration)
    Tool registered in MCP server with name 'get_promotions', description, schema, and handler.
    {
      name: 'get_promotions',
      description: [
        'List current promotional deals across configured Swiss grocery chains.',
        'Filter by chain, keyword, store ID, or how many days until the promotion expires.',
        'Returns promotion name, discount, validity dates, and applicable stores.',
        'Use for "what is on sale this week?", "any Migros deals on cheese?", or "promotions ending today".',
      ].join(' '),
      schema: getPromotionsSchema,
      handler: getPromotionsHandler,
    },
  • src/index.ts:177-198 (registration)
    MCP CallToolRequest handler: finds tool by name, parses args with Zod schema, invokes handler, returns JSON result.
    server.setRequestHandler(CallToolRequestSchema, async (req) => {
      const tool = TOOLS.find((t) => t.name === req.params.name);
      if (!tool) throw new Error(`Unknown tool: ${req.params.name}`);
      try {
        const args = tool.schema.parse(req.params.arguments ?? {});
        const result = await (tool.handler as any)(registry, args);
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
      } catch (e) {
        if (e instanceof ToolError) {
          return {
            isError: true,
            content: [{
              type: 'text',
              text: JSON.stringify({ error: e.code, message: e.message, hint: e.hint }, null, 2),
            }],
          };
        }
        throw e;
      }
    });
  • withCapability filters registered adapters by capability (e.g., 'promotions') and optional chain filter.
    withCapability(cap: keyof AdapterCapabilities, filter?: Chain[]): StoreAdapter[] {
      return this.list(filter).filter((a) => a.capabilities[cap]);
    }
Behavior4/5

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

No annotations provided, so description carries full burden. Describes return fields and implies read-only operation. Lacks specifics on caching or rate limits, but acceptable for a simple list tool.

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?

Two sentences, front-loaded with purpose and filters. No fluff; each sentence earns its place.

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?

Covers purpose, filters, and return fields. No output schema required. Could mention pagination but given simplicity, it's largely complete.

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 baseline 3. Description summarizes parameters but adds no new semantic detail beyond what schema already provides.

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 lists promotional deals across Swiss grocery chains, with specific filters. It distinguishes from siblings like search_products or find_stock by focusing on promotions.

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?

Provides example queries ('what is on sale this week?') and mentions filters. Does not explicitly exclude alternative tools, but the examples and context imply when to use it.

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/nicktcode/swissgroceries-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server