format_items
Re-render previously fetched Amazon items into markdown, JSON, or HTML card/grid embeds without re-calling the API. Use to iterate on custom styles or produce embeddable HTML.
Instructions
Re-render Amazon items you already have (from a previous search_items, get_items, or get_variations call) without hitting the API again. Pass the exact structuredContent you received back as response, or pass items directly as an array. This tool IS for producing HTML embeds — the user has by this point explicitly asked for a card/grid/preview. Use it specifically when iterating on customStyles ("make the border hotpink", "dark mode", "bigger price") — it avoids rate-limit pressure and is much faster than re-querying Amazon.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | Alternative to `response`: an array of Item objects. | |
| format | No | Output format. DEFAULT TO 'markdown' OR 'json' when you plan to summarise the results in chat. Use 'html-card' / 'html-grid' ONLY when the user has explicitly asked for an embed, preview, card, widget, grid, or paste-ready HTML — these formats return a full HTML document the user pastes into their blog and are not for in-chat reading. 'markdown' = friendly summary source; 'json' = raw API data for programmatic use; 'html-card' = single product card; 'html-grid' = responsive grid of all items. | markdown |
| response | No | Raw response envelope previously returned in `structuredContent` by search_items / get_items / get_variations. Pass this OR `items`. | |
| retrievedAt | No | ISO-8601 timestamp marking when the original response was fetched from Amazon. Rendered next to the price as "as of <ts>". If omitted, defaults to now — but you should pass the original fetch time when re-rendering old data so the displayed timestamp stays truthful. | |
| customStyles | No | Extra CSS appended to the default stylesheet when format is 'html-card' or 'html-grid'. Target stable class-name anchors: .amzn-card, .amzn-card__image, .amzn-card__title, .amzn-card__meta, .amzn-card__brand, .amzn-card__rating, .amzn-card__price, .amzn-card__price--unavailable, .amzn-card__savings, .amzn-card__cta, .amzn-card__disclosure, .amzn-grid. Ignored for 'markdown' and 'json'. | |
| titleMaxChars | No | Maximum rendered title length for HTML card/grid output. Amazon titles are often 150+ chars of keyword stuffing; clamping to ~80 keeps cards one-line on typical widths. Defaults to 80. Set to 0 to disable. Ignored by 'markdown' and 'json' — those formats get the full untruncated title. | |
| hideItemsWithoutPrice | No | When format is 'html-grid', drop items that have no price. Defaults to true — cards without a price are weak embeds (no deal hook, reader must click through to learn anything). Set false for comparison tables where availability can lapse but you still want the product visible. Ignored for 'html-card', 'markdown', and 'json'. |