Skip to main content
Glama

get_product_details

Get the details of one or more products. The details are the variants, the options, and the images.

Arguments

productIds - The list of product IDs. Get these IDs from the 'search_products' tool. Request only the products that the user needs. The server has a maximum count of IDs. The default maximum is 20. If you send too many IDs, the server returns an error. Then send fewer IDs. option_values - The option IDs and the value IDs of one variant. Use this argument with one product ID only. This argument applies to the B2C catalog. For a B2B buyer, the tool returns all the variants. Then select one variant. channelId - Optional. This argument selects the B2B catalog. The default is the channel of the request. variantCursor - Optional. This argument gets the next page of variants. Use this argument with one product ID only. Take the value from 'nextVariantCursor' in the previous result. If 'nextVariantCursor' is absent, or is null, or is the text "null", do not send this argument.

Results

The tool returns a list of products in 'products'. The output schema gives all the fields. A product has 'modifierOptions' only if the product has modifier options. A product has 'variantOptions' only if the product has variant options. A variant has a price, an inventory level, a purchase flag, and bulk prices only for a B2B buyer. If the tool does not find a product, the list does not include that product.

Modifier options

A modifier option is a product choice that is not a variant. Examples are an engraving message and a gift note. A variant option is never a modifier option.

If a product has no 'modifierOptions', add the product to the cart without 'selectedOptions'.

An option is required if 'isRequired' is 'true'. Send each required option to the 'add_item_to_cart' tool. If you do not send a required option, the server does not add the item. A variant selection does not replace a required option.

Each option has 'optionEntityId', 'displayName', and 'selectedOptionsKey'. 'selectedOptionsKey' is the name of the field to send the option in. A choice option has 'values'. Each value has 'valueEntityId' and 'label'. A free-entry option has 'constraints' in place of 'values'.

If 'unsupported' is 'true', you cannot send the option. A file upload is one example. If such an option is also required, tell the user to buy the product on the website.

Variant options

A variant option is a product choice that selects a variant. Examples are a size and a colour. The tool returns these options in 'variantOptions'. Each option has 'optionEntityId', 'displayName', 'isRequired', and 'values'. Each value has 'valueEntityId' and 'label'. The default value has 'isDefault'.

A variant lists only the values that it uses. A value can have no variant. The default value, such as "None", is often one. 'variantOptions' lists every value, so use it to find a value that no variant lists.

'hasVariant' tells you if a variant in the list uses the value. The tool sets 'hasVariant' only if it returned the whole list of variants. That is when 'hasMoreVariants' is absent and you sent no 'option_values' and no 'variantCursor'. For a B2B buyer the tool always returns the whole list, and the list includes variants that cannot be bought. If 'hasVariant' is 'false', no variant that can be bought uses the value. The value has no variant, or its variants are not on sale now. If the list of variants is empty, every value has 'hasVariant' of 'false'. If 'hasVariant' is absent, you do not know. 'hasVariant' is about one value. If the product has more than one variant option, a combination of values can have no variant even if each value has one.

Variant pages

The list of variants can be one page of a longer list. The server sets the page size.

If 'hasMoreVariants' is 'true', more variants exist than the tool returned. Then do not tell the user that a variant does not exist. You did not receive all the variants.

To get the next page, call this tool again. Send the same product ID, and only that product ID. Send 'variantCursor' with the value of 'nextVariantCursor'.

A filter is better than a page walk. If the user named the variant, send 'option_values' instead. One filtered call is cheaper than many pages.

Do not change 'option_values' between pages. The cursor is a position in the list of the previous call. A different filter gives the wrong variants.

Stock

Each product has 'inStock'. It tells you if the store has units in stock. It does not tell you if the user can buy the product.

If 'inStock' is 'false', do not refuse the request. Many stores accept orders for products that are not in stock. Tell the user that the product is not in stock, and that delivery can take more time. Then add the product if the user agrees. If the store blocks the purchase, the 'add_item_to_cart' tool fails and gives a reason. Give that reason to the user.

If 'inStock' is 'true', the store reports no out-of-stock condition. A store that does not count stock reports 'true' for all products. Therefore do not tell the user a quantity.

'inventoryLevel' is present only if the store publishes stock counts. If 'inventoryLevel' is absent, the count is unknown. The count is not zero.

Each variant has its own 'inStock'. Use the value of the variant if you add one variant.

Steps

  1. Call the 'search_products' tool to get the product IDs.

  2. Call this tool with the product IDs.

  3. Call the 'add_item_to_cart' tool with the results of step 1 and step 2.

If the configuration that the user chose has a variant, you must tell the 'add_item_to_cart' tool which variant to add. If it has no variant, see "Configurations with no variant" in the 'add_item_to_cart' tool. Do not use that path for a configuration that does not exist. If a product has required modifier options, you must send those options.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "productIds": "<productIds>"
    },
    "name": "get_product_details"
  }
}

Input Schema

NameRequiredDescriptionDefault
channelIdNo
productIdsYes
option_valuesNo
variantCursorNo

Output Schema

NameRequiredDescriptionDefault
messageNo
successYes
productsYes
totalCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / products / items / properties / variantOptions
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "displayName": {
      +        "type": "string"
      +      },
      +      "isRequired": {
      +        "type": "boolean"
      +      },
      +      "optionEntityId": {
      +        "type": "integer"
      +      },
      +      "values": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "hasVariant": {
      +              "type": [
      +                "null",
      +                "boolean"
      +              ]
      +            },
      +            "isDefault": {
      +              "type": "boolean"
      +            },
      +            "label": {
      +              "type": "string"
      +            },
      +            "valueEntityId": {
      +              "type": "integer"
      +            }
      +          },
      +          "required": [
      +            "valueEntityId",
      +            "label"
      +          ],
      +          "type": "object"
      +        },
      +        "type": [
      +          "null",
      +          "array"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "optionEntityId",
      +      "displayName",
      +      "isRequired"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so: a server-side max of ~20 IDs with an error-and-retry path, B2C vs B2B catalog differences via 'channelId', pagination semantics, when 'hasVariant' is trustworthy and when it is absent, and that missing products are silently omitted from the list. It also discloses that 'inStock' is not a purchasability check and that 'inventoryLevel' absence means unknown, not zero.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Headings and front-loading are good, and each section targets a genuine ambiguity, but the text is very long for a details tool and repeats rules already stated (the single-product limitation on option_values and variantCursor appears in both 'Arguments' and 'Variant pages'). Several paragraphs address how to phrase stock caveats to the user and how to call 'add_item_to_cart', which belong to those tools or the workflow rather than this one.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return shape need not be spelled out, yet the description adds the conditional-field semantics an agent needs: modifierOptions/variantOptions presence, B2B-only price and bulk fields, required modifiers that must be forwarded to add_item_to_cart, and unsupported required options that must be escalated to the user. Nothing essential for a correct call is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description documents all four parameters: productIds (list of IDs plus the max-count constraint), option_values (optionEntityId/valueEntityId pair, single-product only, B2C only), channelId (selects the B2B catalog, defaults to the request channel), and variantCursor (value taken from 'nextVariantCursor', single-product only, invalid when null or "null"). This fully compensates for the empty 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?

States a specific verb and resource ('Get the details of one or more products') and enumerates the returned detail types (variants, options, images). It also names 'search_products' as the source of IDs, so the agent can distinguish this tool from its sibling without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit sequencing (search_products -> this tool -> add_item_to_cart) and routing rules: use 'option_values' rather than walking pages when the user named a variant, use 'variantCursor' only for the next page with a single product ID and unchanged filter. It also states when not to act, e.g. do not tell the user a variant does not exist while 'hasMoreVariants' is true.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources