8.4 KiB
DBK Platform MCP Guide for LLMs
This guide explains how to use the DBK Platform MCP tools safely and consistently. The tools operate on the active tenant's data and configuration; do not infer another tenant's catalog, brand, or enabled integrations from an example.
HomAroma is the reference tenant. See
docs/PLATFORM_OVERVIEW.mdfor platform terminology.
Core Rules
- Prefer the dedicated block tools over the generic
add_page_section/update_page_sectiontools when available. - Use
update_page_translationswhen you need to set several languages for a page title in one call. - Treat localized fields and plain strings differently.
- Read back the page after edits when you need confirmation.
Finding a Page
- Use
get_dynamic_page_detailwith the page slug when you already know the slug. - Use
list_dynamic_pages_metadatawhen you need to search all pages quickly. - The dynamic page detail response includes the page
id, which is thepageIdyou use for section tools.
Create Page Response Contract
Use create_page_with_section only when the slug does not exist. It atomically
creates a new page and its first section; it does not update an existing page.
If it returns PAGE_SLUG_EXISTS, use the returned pageId with
add_page_section.
To add another block to an existing page:
- Call
get_dynamic_page_detailwith the slug. - Call
get_page_block_schemafor the desired block type. - Call
add_page_sectionwith the returned pageid. - Call
reorder_page_sectionsif the new block must move relative to existing blocks. - Read the page back with
get_dynamic_page_detail.
create_dynamic_page now returns a structured response that is easy for LLMs to parse:
successoperationpageIdslugtitleisPublisheddiagnosticpage
Use diagnostic as the human-readable explanation, not as the only signal of success.
Section Tool Mapping
update_hero_articleupdate_rich_textupdate_scent_notes_breakdownupdate_quote_calloutupdate_product_carouselupdate_accordionupdate_contact_infoupdate_contact_form
These tools return a normalized response with:
successtoolsectionTypesectionIdupdatedFieldsappliedPayloadnotessection
Payload Shape Cheat Sheet
Localized string
Use this when a field can be translated:
{ "th": "ข้อความภาษาไทย", "en": "English text" }
Plain string
Use one string only for URLs, slugs, IDs, and booleans/numbers as appropriate.
Block-Specific Rules
HERO_ARTICLE
- Localized:
title,subtitle,author,category - Plain string:
publishDate,date,imageUrl,backgroundImageUrl,overlayColor - The image is passed as a URL string in
imageUrl
RICH_TEXT
titleis optional and localizedcontentis required and localized- HTML is allowed in
content
ARTICLE_MEDIA
bodyis required, localized plain text; do not send HTMLheading,imageAlt, andimageCaptionare localizedimageUrlis a plain URL or website-relative media pathimageAltis required wheneverimageUrlis presentimagePositionacceptsleft,right, ortopwidthacceptsnarrow,standard, orwidebackgroundacceptsdefaultormuted
Article composition blocks
ARTICLE_HEADER: article title, subtitle, category, author, date, and optional cover imageARTICLE_GALLERY: 2–8 images with required localized alt text; layouts aregridorfeaturedARTICLE_FACTS: 1–8 concise facts or key takeawaysARTICLE_VIDEO: HTTPS YouTube, Vimeo, or direct video URL; embed HTML is not acceptedARTICLE_REFERENCES: 1–20 references with optional verified HTTPS URLs and notesARTICLE_TABLE: responsive technical comparison with 2–6 columnsARTICLE_DOWNLOAD: 1–10 verified HTTPS documentsARTICLE_CTA: one primary action and an optional secondary action- Reuse
QUOTE_CALLOUT,ACCORDION, andPRODUCT_CAROUSELinstead of creating duplicate article-only variants
SCENT_NOTES_BREAKDOWN
titleanddescriptionare localized- Each note item may be a plain string or a localized string object
heartNotesandmiddleNotesare mirrored by the backend
QUOTE_CALLOUT
quoteis required and localizedauthorandroleare optional localized fields
PRODUCT_CAROUSEL
titleanddescriptionare localizedcollectionId,limit,showPrice,showAddToCart, andproductsare plain values- If
productsis omitted, the backend can auto-populate products on read-back
ACCORDION
titleis optional and localizedcategoriesis required- Each category needs:
- localized
name - optional
icon - at least one question
- localized
- Each question needs localized
qanda
CONTACT_INFO
titleis optional and localizedaddressandhoursare localizedemailandlineare plain strings
CONTACT_FORM
titleandsubtitleare localized- There are no extra fields
Recommended Flow
- Determine whether the page already exists.
- For a new page, use
create_page_with_sectionfor the page and first block. - For an existing page, get its id and use
add_page_section. - Create or update the page title translations.
- Update existing sections using the dedicated block tool when possible.
- Read back the page with
get_dynamic_page_detail. - If a section has auto-populated fields, trust the read-back result over the raw update payload.
Translating Page Builder Blocks
Translate one language and one block at a time. This keeps the context compact and prevents a full payload replacement from overwriting existing languages.
- Call
get_page_translation_statuswithpageIdand the targetlang. - Pick one incomplete
sectionId. - Call
get_page_section_translationwith thatsectionIdand targetlang. The default fallback supplies source text for untranslated fields and lists those fields infallbackPaths. - Translate the fields listed in
fallbackPaths; preserve the payload's object and array shape. - Call
update_section_translationwithtranslationsand theupdatedAtvalue asexpectedUpdatedAt. - Read the block again with
get_page_section_translationand confirmfallbackPathsis empty.
update_section_translation changes only the requested language in registered localized fields. It preserves other languages, URLs, IDs, layout configuration, and other non-translatable values. A SECTION_VERSION_CONFLICT response means the block changed after it was read; fetch it again before retrying.
Use get_page_section with lang=all only when every stored language map is genuinely needed. A specific language returns resolved strings and uses fallback by default.
Editing Footer Menus
footer-explore and footer-support are flat menus shared by Admin, Backend, MCP, and Website. They are not Page Builder sections and do not use the Mega Menu tree tools.
- Call
get_footer_menuwithmenuNameand the targetlang. - Keep the returned
version. - Preview one item-level mutation with
dryRun=trueandexpectedVersion. - Apply only after the preview is correct.
- Read the menu again and verify the result.
Use update_footer_menu_item_translation for one language at a time. Use reorder_footer_menu_items only with the complete list of current item IDs. If the backend returns MENU_VERSION_CONFLICT, discard the old version and read the menu again.
An allowed Footer menu may not exist before its first item is saved. In that case, get_footer_menu returns exists=false and version=null. Run add_footer_menu_item with dryRun=true; a willCreateMenu=true preview confirms that the actual add will create the active menu and first item atomically.
Do not use legacy update_footer_content for menu arrays. It remains available only for the Footer brand description and social links. Website Collections come from Categories, not a Footer menu.
What to Expect
PRODUCT_CAROUSELmay return products even when you did not send them.SCENT_NOTES_BREAKDOWNmay show mirrored note groups in the response.create_dynamic_pageshould now return a clear success/error contract.
Safe Usage Tips
- Do not guess the field shape from the UI alone.
- If a field is a URL, send a URL string.
- If a field is translated, send a localized object.
- If you are unsure, inspect an existing page with
get_dynamic_page_detailfirst.