From 1a13b3624af254c15895745ec265cf1673f1eb16 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 27 Jun 2026 20:11:34 -0400 Subject: [PATCH] x --- apps/backend/query.ts | 7 +++++++ apps/mcp-server/section-toolkit.ts | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 apps/backend/query.ts diff --git a/apps/backend/query.ts b/apps/backend/query.ts new file mode 100644 index 0000000..e24da0c --- /dev/null +++ b/apps/backend/query.ts @@ -0,0 +1,7 @@ +import { PrismaClient } from '@prisma/client'; +const prisma = new PrismaClient(); +async function main() { + const section = await prisma.pageSection.findUnique({ where: { id: 37 } }); + console.log(JSON.stringify(section, null, 2)); +} +main().finally(() => prisma.$disconnect()); diff --git a/apps/mcp-server/section-toolkit.ts b/apps/mcp-server/section-toolkit.ts index a21e83d..aafbf10 100644 --- a/apps/mcp-server/section-toolkit.ts +++ b/apps/mcp-server/section-toolkit.ts @@ -23,7 +23,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_hero_article", sectionType: "HERO_ARTICLE", - description: `Update a HERO_ARTICLE section. Use localized objects for title, subtitle, author, and category. Use plain strings for image URLs, overlayColor, publishDate/date, and buttonLink. Example payload: { "sectionId": 12, "title": ${localizedStringExample}, "subtitle": ${localizedStringExample}, "author": ${localizedStringExample}, "imageUrl": "https://..." }`, + description: `Update a HERO_ARTICLE section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. Use localized objects for title, subtitle, author, and category. Use plain strings for image URLs, overlayColor, publishDate/date, and buttonLink. Example payload: { "sectionId": 12, "title": ${localizedStringExample}, "subtitle": ${localizedStringExample}, "author": ${localizedStringExample}, "imageUrl": "https://..." }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized article title, for example ${localizedStringExample}` }, @@ -41,7 +41,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_editorial_tile", sectionType: "EDITORIAL_TILE", - description: `Update an EDITORIAL_TILE section. Title, description, and buttonText are localized. imageUrl, imagePosition, buttonLink, backgroundColor, and textColor are plain strings. Example payload: { "sectionId": 12, "title": ${localizedStringExample}, "description": ${localizedStringExample}, "imageUrl": "https://..." }`, + description: `Update an EDITORIAL_TILE section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. Title, description, and buttonText are localized. imageUrl, imagePosition, buttonLink, backgroundColor, and textColor are plain strings. Example payload: { "sectionId": 12, "title": ${localizedStringExample}, "description": ${localizedStringExample}, "imageUrl": "https://..." }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, imageUrl: { type: "string", description: "Plain string main image URL" }, @@ -58,7 +58,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_rich_text", sectionType: "RICH_TEXT", - description: `Update a RICH_TEXT section. Title is optional and localized. Content is required and may be HTML or plain text per language. Example payload: { "sectionId": 34, "title": ${localizedStringExample}, "content": ${localizedStringExample} }`, + description: `Update a RICH_TEXT section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. Title is optional and localized. Content is required and may be HTML or plain text per language. Example payload: { "sectionId": 34, "title": ${localizedStringExample}, "content": ${localizedStringExample} }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized title displayed above the content, for example ${localizedStringExample}` }, @@ -69,7 +69,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_scent_notes_breakdown", sectionType: "SCENT_NOTES_BREAKDOWN", - description: `Update a SCENT_NOTES_BREAKDOWN section. Title and description are localized. Each note item can be a plain string or a localized object. Use either heartNotes or middleNotes; the backend mirrors whichever one you provide so both stay in sync. Example payload: { "sectionId": 40, "title": ${localizedStringExample}, "topNotes": ${localizedStringListExample} }`, + description: `Update a SCENT_NOTES_BREAKDOWN section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. Title and description are localized. Each note item can be a plain string or a localized object. Use either heartNotes or middleNotes; the backend mirrors whichever one you provide so both stay in sync. Example payload: { "sectionId": 40, "title": ${localizedStringExample}, "topNotes": ${localizedStringListExample} }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized title, for example ${localizedStringExample}` }, @@ -84,7 +84,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_quote_callout", sectionType: "QUOTE_CALLOUT", - description: `Update a QUOTE_CALLOUT section. Quote is required and localized. Author and role are optional localized fields. Example payload: { "sectionId": 48, "quote": ${localizedStringExample}, "author": ${localizedStringExample}, "role": ${localizedStringExample} }`, + description: `Update a QUOTE_CALLOUT section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. Quote is required and localized. Author and role are optional localized fields. Example payload: { "sectionId": 48, "quote": ${localizedStringExample}, "author": ${localizedStringExample}, "role": ${localizedStringExample} }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, quote: { ...localizedStringSchema, description: `Localized quote text, for example ${localizedStringExample}` }, @@ -96,7 +96,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_product_carousel", sectionType: "PRODUCT_CAROUSEL", - description: `Update a PRODUCT_CAROUSEL section. Title and description are localized. collectionId, limit, showPrice, showAddToCart, and products are plain values. If products is omitted, backend can auto-populate products on read-back using collectionId/type/productIds/limit. Example payload: { "sectionId": 52, "title": ${localizedStringExample}, "collectionId": "summer", "limit": 6, "showPrice": true }`, + description: `Update a PRODUCT_CAROUSEL section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. Title and description are localized. collectionId, limit, showPrice, showAddToCart, and products are plain values. If products is omitted, backend can auto-populate products on read-back using collectionId/type/productIds/limit. Example payload: { "sectionId": 52, "title": ${localizedStringExample}, "collectionId": "summer", "limit": 6, "showPrice": true }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized title, for example ${localizedStringExample}` }, @@ -112,7 +112,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_accordion", sectionType: "ACCORDION", - description: `Update an ACCORDION section. title is optional and localized. categories is required. Each category needs a localized name, optional icon, and at least one question. Each question needs localized q and a fields. Example payload: { "sectionId": 60, "categories": [ { "name": ${localizedStringExample}, "questions": [ { "q": ${localizedStringExample}, "a": ${localizedStringExample} } ] } ] }`, + description: `Update an ACCORDION section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. title is optional and localized. categories is required. Each category needs a localized name, optional icon, and at least one question. Each question needs localized q and a fields. Example payload: { "sectionId": 60, "categories": [ { "name": ${localizedStringExample}, "questions": [ { "q": ${localizedStringExample}, "a": ${localizedStringExample} } ] } ] }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized section title, for example ${localizedStringExample}` }, @@ -146,7 +146,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_contact_info", sectionType: "CONTACT_INFO", - description: `Update a CONTACT_INFO section. title is optional and localized. address and hours are localized text. email and line are plain strings. Example payload: { "sectionId": 72, "title": ${localizedStringExample}, "address": ${localizedStringExample}, "email": "hello@example.com", "line": "@homaroma", "hours": ${localizedStringExample} }`, + description: `Update a CONTACT_INFO section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. title is optional and localized. address and hours are localized text. email and line are plain strings. Example payload: { "sectionId": 72, "title": ${localizedStringExample}, "address": ${localizedStringExample}, "email": "hello@example.com", "line": "@homaroma", "hours": ${localizedStringExample} }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized section title, for example ${localizedStringExample}` }, @@ -160,7 +160,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_contact_form", sectionType: "CONTACT_FORM", - description: `Update a CONTACT_FORM section. title and subtitle are localized; this block has no extra fields. Example payload: { "sectionId": 73, "title": ${localizedStringExample}, "subtitle": ${localizedStringExample} }`, + description: `Update a CONTACT_FORM section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. title and subtitle are localized; this block has no extra fields. Example payload: { "sectionId": 73, "title": ${localizedStringExample}, "subtitle": ${localizedStringExample} }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized form title, for example ${localizedStringExample}` }, @@ -171,7 +171,7 @@ const SECTION_TOOL_CONFIGS = [ { name: "update_editorial_carousel", sectionType: "EDITORIAL_CAROUSEL", - description: `Update an EDITORIAL_CAROUSEL section. title, description, and slides are supported. Example payload: { "sectionId": 12, "title": ${localizedStringExample}, "description": ${localizedStringExample} }`, + description: `Update an EDITORIAL_CAROUSEL section. This tool performs a partial update/merge (PATCH). Omitted fields are preserved. The 'sectionId' argument correlates to the 'id' field in the fetched payload. title, description, and slides are supported. Example payload: { "sectionId": 12, "title": ${localizedStringExample}, "description": ${localizedStringExample} }`, properties: { sectionId: { type: "number", description: "The numeric ID of the section to update" }, title: { ...localizedStringSchema, description: `Localized section title, for example ${localizedStringExample}` },