UNPKG

@iflow-mcp/claudeus-wp-mcp

Version:

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

76 lines 2.69 kB
export async function handleWidgetTools(name, args, client) { switch (name) { // ========================================== // SIDEBARS // ========================================== case 'claudeus_wp_widgets__get_sidebars': { const sidebars = await client.getSidebars(args.filters); return { content: [{ type: "text", text: JSON.stringify(sidebars, null, 2) }] }; } case 'claudeus_wp_widgets__get_sidebar': { const sidebar = await client.getSidebar(args.id); return { content: [{ type: "text", text: JSON.stringify(sidebar, null, 2) }] }; } // ========================================== // WIDGETS // ========================================== case 'claudeus_wp_widgets__get_widgets': { const widgets = await client.getWidgets(args.filters); return { content: [{ type: "text", text: JSON.stringify(widgets, null, 2) }] }; } case 'claudeus_wp_widgets__get_widget': { const widget = await client.getWidget(args.id); return { content: [{ type: "text", text: JSON.stringify(widget, null, 2) }] }; } case 'claudeus_wp_widgets__create_widget': { const widget = await client.createWidget(args.data); return { content: [{ type: "text", text: JSON.stringify(widget, null, 2) }] }; } case 'claudeus_wp_widgets__update_widget': { const widget = await client.updateWidget(args.id, args.data); return { content: [{ type: "text", text: JSON.stringify(widget, null, 2) }] }; } case 'claudeus_wp_widgets__delete_widget': { const result = await client.deleteWidget(args.id, args.force ?? true); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } default: throw new Error(`Unknown widget tool: ${name}`); } } //# sourceMappingURL=handlers.js.map