Skip to main content
Glama
nicktcode

Swissgroceries MCP

get_product

Retrieve complete product details including price, brand, size, unit price, tags, category, image, and active promotions for a specific grocery chain and product ID. Use after searching products to drill into a result.

Instructions

Fetch full product details for a specific chain + product ID pair. Returns price, brand, size, unit price, tags, category, image URL, and active promotions. Obtain product IDs from search_products. Useful for drilling into a search result. Use for "get details for this Migros product" or "what is the unit price of this item?".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYesThe grocery chain that owns this product ID.
idYesChain-specific product identifier, e.g. Migros cumulus ID or Coop product number. Obtain via search_products.

Implementation Reference

  • The getProductHandler function that executes the tool logic. It looks up the chain-specific adapter from the registry, calls adapter.getProduct(input.id), and returns the normalized product or throws a ToolError on failure.
    export async function getProductHandler(
      registry: AdapterRegistry,
      input: GetProductInput,
    ): Promise<NormalizedProduct | null> {
      const adapter = registry.get(input.chain);
      if (!adapter) {
        throw new ToolError(
          'adapter_not_registered',
          `No adapter registered for chain "${input.chain}"`,
          'Ensure the chain is enabled in the server configuration. For Denner, set the DENNER_JWT env var.',
        );
      }
      const r = await adapter.getProduct(input.id);
      if (!r.ok) {
        throw new ToolError(
          r.error.code,
          `Product fetch failed for ${input.chain}/${input.id}: ${r.error.code}`,
          r.error.code === 'not_found'
            ? 'The product ID may be invalid or discontinued. Re-run search_products to get a fresh ID.'
            : 'Try again later or use search_products to find an alternative.',
        );
      }
      return r.data;
    }
  • The getProductSchema Zod schema defining the input: 'chain' (enum of supported grocery chains) and 'id' (string, min 1). Describes the tool purpose.
    export const getProductSchema = z.object({
      chain: z.enum(['migros', 'coop', 'aldi', 'denner', 'lidl', 'farmy', 'volgshop', 'ottos'])
        .describe('The grocery chain that owns this product ID.'),
      id: z.string().min(1)
        .describe('Chain-specific product identifier, e.g. Migros cumulus ID or Coop product number. Obtain via search_products.'),
    }).describe('Fetch full product details (price, size, tags, promotions) for a specific chain + product ID pair. Use after search_products to drill into a result.');
  • src/index.ts:72-81 (registration)
    Registration of the 'get_product' tool in the MCP server with name, description, schema, and handler. Imported at line 25 from './tools/get_product.js'.
    {
      name: 'get_product',
      description: [
        'Fetch full product details for a specific chain + product ID pair.',
        'Returns price, brand, size, unit price, tags, category, image URL, and active promotions.',
        'Obtain product IDs from search_products. Useful for drilling into a search result.',
        'Use for "get details for this Migros product" or "what is the unit price of this item?".',
      ].join(' '),
      schema: getProductSchema,
      handler: getProductHandler,
  • The getProduct method signature in the StoreAdapter interface that all chain adapters must implement. Returns Promise<AdapterResult<NormalizedProduct | null>>.
      getProduct(id: string): Promise<AdapterResult<NormalizedProduct | null>>;
      searchStores(q: StoreQuery): Promise<AdapterResult<NormalizedStore[]>>;
      getPromotions(q: PromotionQuery): Promise<AdapterResult<NormalizedPromotion[]>>;
      findStoresWithStock?(productId: string, near?: GeoPoint): Promise<AdapterResult<StockResult[]>>;
    }
Behavior3/5

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

No annotations provided, so description carries the burden. It mentions return fields but does not disclose whether the operation is read-only, has side effects, or any error conditions. The description implies a safe fetch but lacks explicit behavior details.

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?

Description is four sentences, fairly concise and front-loaded with main purpose. 'Useful for drilling into a search result' is slightly redundant given the example usage, but overall well-structured.

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 no output schema or annotations, the description reasonably covers return fields, usage guidance, and parameter source. It could be more complete by noting non-destructive nature or error handling, but for a simple tool it is adequate.

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 coverage is 100%, so baseline is 3. Description adds value by explaining that id is chain-specific and obtained via search_products, but does not significantly augment the semantic meaning beyond schema.

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?

Description clearly states the action (fetch full product details) and resource (chain + product ID pair). It lists return fields and distinguishes from sibling search_products by specifying that product IDs come from search_products. Usage examples reinforce purpose.

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?

Description explicitly says to obtain product IDs from search_products and gives example queries. It provides context for when to use (drilling into search results) but does not specify when not to use or mention alternatives like get_promotions.

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