x
This commit is contained in:
1 parent
94cbb52348
commit
167d07f0c2
7 files changed
+1284
-21
No files matched your search
+16
-20
@@ -6,7 +6,7 @@ import {
|
||||
} from "@modelcontextprotocol/sdk/types.js";
|
||||
import axios from "axios";
|
||||
import FormData from "form-data";
|
||||
import { MENU_TOOL_DEFINITIONS, handleMenuTool } from "./menu-toolkit";
|
||||
import { MENU_TOOL_DEFINITIONS, getLegacyFooterMenuDeprecation, handleMenuTool } from "./menu-toolkit";
|
||||
import { SECTION_TOOL_DEFINITIONS, buildCmsPreview, handleSectionTool } from "./section-toolkit";
|
||||
const LOCAL_BACKEND_URL = process.env.MCP_BACKEND_URL_LOCAL || "http://localhost:3051/api";
|
||||
const PRODUCTION_BACKEND_URL = process.env.MCP_BACKEND_URL_PRODUCTION || "https://api.homaroma.shop/api";
|
||||
@@ -949,7 +949,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
{
|
||||
name: "update_footer_content",
|
||||
description: "Update the content and links of the 4 Footer Blocks (Brand, Explore, Collections, Newsletter)",
|
||||
description: "Legacy tool for Footer brand description and social links only. Footer menu arrays are rejected; use the Footer-specific item tools instead.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
@@ -965,7 +965,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
exploreLinks: {
|
||||
type: "array",
|
||||
description: "Array of { label, url, order } for Block 2 (Explore)",
|
||||
description: "Deprecated and rejected. Use add_footer_menu_item, update_footer_menu_item, delete_footer_menu_item, or reorder_footer_menu_items.",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: { label: { type: "string" }, url: { type: "string" }, order: { type: "number" } }
|
||||
@@ -973,7 +973,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
collectionLinks: {
|
||||
type: "array",
|
||||
description: "Array of { label, url, order } for Block 3 (Collections)",
|
||||
description: "Deprecated and rejected. Website Collections come from Categories, not a footer menu.",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: { label: { type: "string" }, url: { type: "string" }, order: { type: "number" } }
|
||||
@@ -981,7 +981,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
supportLinks: {
|
||||
type: "array",
|
||||
description: "Array of { label, url, order } for Block 4 (Support/Legal)",
|
||||
description: "Deprecated and rejected. Use the Footer-specific item tools with menuName=footer-support.",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: { label: { type: "string" }, url: { type: "string" }, order: { type: "number" } }
|
||||
@@ -1661,6 +1661,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
return { content: [{ type: "text", text: JSON.stringify(normalized, null, 2) }] };
|
||||
}
|
||||
case "update_footer_content": {
|
||||
const deprecation = getLegacyFooterMenuDeprecation(params);
|
||||
if (deprecation) {
|
||||
return {
|
||||
content: [{
|
||||
type: "text",
|
||||
text: JSON.stringify(deprecation, null, 2),
|
||||
}],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
|
||||
const results = [];
|
||||
|
||||
if (params.brandDescription !== undefined || params.socialLinks) {
|
||||
@@ -1687,21 +1698,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (params.exploreLinks) {
|
||||
await api.put("/menus/footer-explore", { items: params.exploreLinks });
|
||||
results.push({ type: "explore_links", status: "success" });
|
||||
}
|
||||
|
||||
if (params.collectionLinks) {
|
||||
await api.put("/menus/footer-collections", { items: params.collectionLinks });
|
||||
results.push({ type: "collection_links", status: "success" });
|
||||
}
|
||||
|
||||
if (params.supportLinks) {
|
||||
await api.put("/menus/footer-support", { items: params.supportLinks });
|
||||
results.push({ type: "support_links", status: "success" });
|
||||
}
|
||||
|
||||
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user