Skip to main content
Glama

kapruka_render_options_card

Read-onlyIdempotent

Render 1-4 products as ONE shareable JPEG "menu" card and return its URL.

The card shows each product's photo with a big numbered badge (the ref you
assign), and its name + price printed under the photo. Built for chat
commerce (WhatsApp): send the image, tell the customer "reply 1, 2 or 3",
and they pick without opening links. No AI is involved — the image is
server-composited from the live catalog data, so prices match what the
product tools return.

Ref numbering contract: refs are yours to assign — use sequential numbers
per conversation and NEVER reuse one (if the first card was 1-3, the next
card starts at 4). A number must keep meaning the same product for the whole
conversation.

Args:
    params (RenderOptionsCardInput):
        - items (list[CardProduct]): 1-4 of {product_id, ref}
        - currency (str): LKR (default), USD, GBP, AUD, EUR
        - courtesy ({currency, per_usd}, optional): home-currency figure printed
          under each USD price ("≈ JPY 2,544"); the caller's rate, echoed back
        - footer_note (str, optional): appended to the footer reply hint

Returns:
    str: JSON:
    {
      "card_url": str,              # public JPEG URL — send this as the image
      "items": [{"ref": int, "product_id": str, "name": str,
                  "price": {"amount": float, "currency": str},
                  "price_note": str | null, "url": str}],
      "courtesy": {"currency": str, "per_usd": float} | null,  # what was printed, or null
      "unavailable": [str]          # product_ids that failed to load (omitted from card)
    }

    Error: "Error: <message>" when no product could be loaded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $defs / RenderOptionsCardInput / properties / currency / description
      Previous value: -"Price currency: LKR, USD, GBP, AUD, CAD, EUR."New value: +"Price currency: LKR, USD, GBP, AUD, EUR."
  2. Changed3 schema fields changed
    • addedInput schema / $defs / Courtesy
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "A home-currency approximation to print under each USD price.\n\nThe CALLER supplies the rate it used for its own chat text, so the card and\nthe text agree to the unit; the card never converts on its own. Only\napplied when the card is priced in USD — the courtesy figure describes\nwhat a USD charge will look like on the customer's statement.",
      +  "properties": {
      +    "currency": {
      +      "description": "ISO-4217 code of the customer's home currency, e.g. JPY.",
      +      "maxLength": 3,
      +      "minLength": 3,
      +      "pattern": "^[A-Za-z]{3}$",
      +      "title": "Currency",
      +      "type": "string"
      +    },
      +    "per_usd": {
      +      "description": "Units of that currency per 1 USD, as used for the chat text.",
      +      "exclusiveMaximum": 1000000,
      +      "exclusiveMinimum": 0,
      +      "title": "Per Usd",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "currency",
      +    "per_usd"
      +  ],
      +  "title": "Courtesy",
      +  "type": "object"
      +}
    • addedInput schema / $defs / RenderOptionsCardInput / properties / courtesy
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/Courtesy"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional: print '≈ <home currency>' under each USD price (see Courtesy). Ignored unless currency is USD."
      +}
    • addedInput schema / $defs / RenderOptionsCardInput / properties / footer_note
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 60,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional short note appended to the footer's reply hint, e.g. 'Checkout charges USD'.",
      +  "title": "Footer Note"
      +}
  3. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint, openWorldHint, idempotentHint, destructiveHint), the description discloses meaningful behavior: server-side composition with no AI, live catalog pricing, the unavailable-products failure behavior, the 'Error: ...' return mode, and the critical ref-numbering never-reuse contract. These are details an agent could not infer from annotations or the schema alone.

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?

The description is well-structured: a one-line summary, a short use-case paragraph, the ref numbering contract, an Args breakdown, and a return contract. It is longer than average, but each section earns its place and the layout makes it highly scannable for an agent.

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?

The description covers invocation constraints (1-4 items, sequential refs, currency behavior, courtesy rules), return shape (card_url, items, courtesy, unavailable), and error handling when no product loads. With the output schema also present, nothing essential is left for the agent to guess.

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?

Although schema description coverage is reported at 0%, the description's Args block fully compensates: items as 1-4 of {product_id, ref}, currency options with LKR default, courtesy as the caller's rate echoed back under USD prices, and footer_note appended to the reply hint. It also explains the ref numbering contract, which is essential semantic guidance beyond the raw field names.

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 names a precise verb and resource: 'Render 1-4 products as ONE shareable JPEG menu card and return its URL.' It further narrows the purpose with the WhatsApp chat-commerce scenario, numbered ref badges, and the explicit statement that no AI is involved, distinguishing it from the product/search/order siblings.

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 clearly explains when to use the tool: in chat commerce where the customer replies with a number, and notes that the image is server-composited from live catalog data so prices match what the product tools return. It does not explicitly name an alternative tool or a when-not-to-use condition, but the intended usage context is strongly implied.

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.