UNPKG

@iflow-mcp/claudeus-wp-mcp

Version:

The most comprehensive WordPress MCP server - 145 production-ready tools for complete WordPress management with AI

106 lines 3.76 kB
export async function handleMenuTools(name, args, client) { switch (name) { // ========================================== // MENUS CRUD // ========================================== case 'claudeus_wp_menus__get_menus': { const menus = await client.getMenus(args.filters); return { content: [{ type: "text", text: JSON.stringify(menus, null, 2) }] }; } case 'claudeus_wp_menus__get_menu': { const menu = await client.getMenu(args.id); return { content: [{ type: "text", text: JSON.stringify(menu, null, 2) }] }; } case 'claudeus_wp_menus__create_menu': { const menu = await client.createMenu(args.data); return { content: [{ type: "text", text: JSON.stringify(menu, null, 2) }] }; } case 'claudeus_wp_menus__update_menu': { const menu = await client.updateMenu(args.id, args.data); return { content: [{ type: "text", text: JSON.stringify(menu, null, 2) }] }; } case 'claudeus_wp_menus__delete_menu': { const result = await client.deleteMenu(args.id, args.force); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } // ========================================== // MENU ITEMS CRUD // ========================================== case 'claudeus_wp_menus__get_menu_items': { const menuItems = await client.getMenuItems(args.filters); return { content: [{ type: "text", text: JSON.stringify(menuItems, null, 2) }] }; } case 'claudeus_wp_menus__create_menu_item': { const menuItem = await client.createMenuItem(args.data); return { content: [{ type: "text", text: JSON.stringify(menuItem, null, 2) }] }; } case 'claudeus_wp_menus__update_menu_item': { const menuItem = await client.updateMenuItem(args.id, args.data); return { content: [{ type: "text", text: JSON.stringify(menuItem, null, 2) }] }; } case 'claudeus_wp_menus__delete_menu_item': { const result = await client.deleteMenuItem(args.id, args.force); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } // ========================================== // MENU LOCATIONS // ========================================== case 'claudeus_wp_menus__get_locations': { const locations = await client.getMenuLocations(); return { content: [{ type: "text", text: JSON.stringify(locations, null, 2) }] }; } default: throw new Error(`Unknown menu tool: ${name}`); } } //# sourceMappingURL=handlers.js.map