@noleemits/vision-builder-control-mcp 4.35.1 → 4.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +33 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -107,7 +107,7 @@ process.on('SIGINT', () => {
107
107
  // CONFIG
108
108
  // ================================================================
109
109
 
110
- const VERSION = '4.35.1';
110
+ const VERSION = '4.37.0';
111
111
  const MIN_PLUGIN_VERSION = '4.13.0'; // Minimum WP plugin version required by this MCP server
112
112
 
113
113
  // ================================================================
@@ -3263,6 +3263,17 @@ function getToolDefinitions() {
3263
3263
  required: ['target_id', 'section']
3264
3264
  }
3265
3265
  },
3266
+ {
3267
+ name: 'validate_section',
3268
+ description: 'Lint a section JSON for known bug patterns BEFORE submitting it via append_section / build_page / import_template. Detects: (1) class_based_selectors_only — [data-id^="prefix"] selectors that match nested elements; (2) grid_target_e_con_inner — grid CSS on outer container instead of `.your-grid > .e-con-inner`; (3) button_styling_needs_scoped_css — button widgets without scoped CSS override; (4) numeric_dimensional_fields — clamp()/var() in padding/margin/font_size; (5) no_id_prefix_collision — child element ids that start with the parent\'s id. Returns warnings array with rule name, message, and offending element/selector. Run this whenever you generate complex section JSON, especially with custom CSS.',
3269
+ inputSchema: {
3270
+ type: 'object',
3271
+ properties: {
3272
+ section: { type: 'object', description: 'Full Elementor section object to validate (same format as append_section.section)' }
3273
+ },
3274
+ required: ['section']
3275
+ }
3276
+ },
3266
3277
 
3267
3278
  // ── Template Library Tools ──
3268
3279
 
@@ -5630,6 +5641,27 @@ async function handleToolCall(name, args) {
5630
5641
  return ok(msg);
5631
5642
  }
5632
5643
 
5644
+ case 'validate_section': {
5645
+ const r = await apiCall('/validate-section', 'POST', { section: args.section });
5646
+ if (r.code || r.error) return ok(`Failed: ${r.message || r.error || 'Unknown error'}`);
5647
+ let msg = `=== SECTION VALIDATION ===\n`;
5648
+ msg += `Section ID: ${r.section_id || '(none)'} | Elements: ${r.element_count}\n`;
5649
+ msg += `${r.summary}\n`;
5650
+ if (r.errors && r.errors.length) {
5651
+ msg += `\n--- ERRORS (${r.errors.length}) ---\n`;
5652
+ for (const e of r.errors) {
5653
+ msg += ` [${e.rule}] ${e.message}\n`;
5654
+ }
5655
+ }
5656
+ if (r.warnings && r.warnings.length) {
5657
+ msg += `\n--- WARNINGS (${r.warnings.length}) ---\n`;
5658
+ for (const w of r.warnings) {
5659
+ msg += ` [${w.rule}] ${w.message}\n`;
5660
+ }
5661
+ }
5662
+ return ok(msg);
5663
+ }
5664
+
5633
5665
  // ── Template Library Tools ──
5634
5666
 
5635
5667
  case 'template_list_kits': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noleemits/vision-builder-control-mcp",
3
- "version": "4.35.1",
3
+ "version": "4.37.0",
4
4
  "description": "Vision Builder Control MCP server - design token-driven page builder tools for WordPress/Elementor websites",
5
5
  "type": "module",
6
6
  "main": "index.js",