Skip to content

design(mcp): redesign Prefab UI cards across all entities for type-appropriate field hierarchy #537

@dougborg

Description

@dougborg

Summary

The Prefab UI cards we render today were built ad-hoc per tool and surface inconsistent (and often incomplete) information for each entity type. Real session 2026-05-05: agent looked at a get_variant_details card for tubeless tire sealant and had to guess the unit of measure ("250 = 250ml presumably") because UoM isn't on the variant card — even though it's a critical fact for any inventory decision.

Background

13 card builders today in katana_mcp_server/src/katana_mcp/tools/prefab_ui.py:

Builder Tool entry point Entity
build_search_results_ui search_items Search results
build_variant_details_ui get_variant_details Variant
build_item_detail_ui get_item Product/Material/Service
build_inventory_check_ui check_inventory Stock card
build_low_stock_ui list_low_stock_items Reorder list
build_order_preview_ui create_purchase_order / create_sales_order / create_manufacturing_order previews Order
build_order_created_ui post-create Order
build_fulfill_preview_ui / build_fulfill_success_ui fulfill_order Fulfillment
build_verification_ui verify_order_document Document
build_item_mutation_ui create_item / modify_item Item
build_receipt_ui receive_purchase_order Receipt
build_batch_recipe_update_ui modify_manufacturing_order(update_recipe_rows=...) MO recipe batch

Each was built when its tool shipped, with limited cross-pollination. The result is uneven information density, inconsistent visual hierarchy, and missing decision-critical fields.

Design proposal — per-entity field hierarchy

Every card should follow the same three-tier shape, but the specific fields in each tier vary by entity type:

Tier Visual Purpose Field selection
Tier 1 — Identity Header (title + badges) "What is this?" Name + SKU/order_no + type/status
Tier 2 — Decision metrics Big number metrics "What do I need to know to act?" Per-entity: stock for variants, total + status for orders, totals + status for receipts, etc.
Tier 3 — Reference data Small text grid "Where is it / who supplies it / what are the IDs" IDs, dates, supplier/customer name, location
Tier 4 — Actions Footer buttons "What's the most likely next step?" Per-entity: most-likely follow-up (e.g., variant → check inventory; order → modify/fulfill)

The tiers stay constant; the field choices per tier are designed per entity type, not copied from a generic template.

Per-entity priority pass

Each builder should be redesigned with explicit answers to:

  1. What's the agent trying to decide when looking at this card? (e.g., for variant: "should I order more / where is it / what does it consume in")
  2. Which fields are tier 1 / 2 / 3 / 4? (with explicit cut-offs)
  3. What's missing from the response model that the card needs? (e.g., UoM is on the parent item but not on VariantDetailsResponse; stock summary requires a separate fetch)
  4. What actions are most likely next? (different per entity type)

Each builder gets its own focused issue tracking the answer to those four questions + the implementation. This umbrella tracks the rollup.

Sub-issues to file

Builder Issue Status
build_variant_details_ui #TBD (filing alongside this umbrella) filed first
build_item_detail_ui TBD
build_inventory_check_ui TBD (paired with #529)
build_low_stock_ui TBD
build_order_preview_ui (PO / SO / MO) TBD — may split per entity
build_order_created_ui TBD
build_fulfill_preview_ui / build_fulfill_success_ui TBD
build_verification_ui TBD
build_item_mutation_ui TBD
build_receipt_ui TBD
build_batch_recipe_update_ui TBD

(Sub-issues will be filed as the design work is done — this issue tracks the umbrella so subsequent work has context.)

Cross-cutting concerns to settle once

A few decisions affect every builder. Settle these on the variant-details starter first, then apply to the rest:

  1. When to enrich with extra fetches — variant card should arguably show stock summary, but that's a separate API call. Threshold for "worth the round-trip": is the field so important to the typical decision that omitting it makes the card useless? (UoM yes / stock probably yes / config_attributes maybe / barcodes no)
  2. How to render katana_url — currently a separate field; should it be a link button? An auto-attached button on every card?
  3. Action button consistency — every entity card has 0-2 buttons today; should there be a standard action set per entity type?
  4. Empty / N/A handling — when a field is None, do we omit it (current pattern, sometimes), show "N/A" (current pattern, other times), or use a small italic placeholder?

Out of scope

  • Backend response model changes that aren't needed for cards (the response models are already exhaustive for most entities).
  • Markdown rendering changes — this issue is specifically about the Prefab card UI shown in MCP-Apps-capable hosts.
  • New entity tools — restructuring what already exists.

Discovered in

User session 2026-05-05 — agent had to guess unit-of-measure on a tubeless sealant variant because the variant card didn't show UoM, even though the parent item has it.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    developer-experienceDeveloper experience improvementsenhancementNew feature or requestmcp-serverMCP server projectp2-mediumMedium prioritytoolMCP tool implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions