You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -190,6 +191,17 @@ Complete set of tools for managing Mapbox styles via the Styles API:
190
191
- Returns: URL to open the style preview in browser
191
192
-**Note**: This tool automatically fetches the first available public token from your account for the preview URL. Requires at least one public token with `styles:read` scope.
192
193
194
+
**ValidateStyleTool** - Validate Mapbox style JSON against the Mapbox Style Specification
195
+
196
+
- Input: `style` (Mapbox style JSON object or JSON string)
197
+
- Returns: Validation results including errors, warnings, info messages, and style summary
-**Note**: This is an offline validation tool that doesn't require API access or token scopes
204
+
193
205
**⚠️ Required Token Scopes:**
194
206
195
207
**All style tools require a valid Mapbox access token with specific scopes. Using a token without the correct scope will result in authentication errors.**
@@ -358,6 +370,165 @@ Generate a geojson.io URL to visualize GeoJSON data. This tool:
358
370
- "Generate a preview URL for this GeoJSON data"
359
371
- "Create a geojson.io link for my uploaded route.geojson file"
360
372
373
+
#### Validate GeoJSON tool
374
+
375
+
Validates GeoJSON objects for correctness, checking structure, coordinates, and geometry types. This offline validation tool performs comprehensive checks on GeoJSON data without requiring API access.
376
+
377
+
**Parameters:**
378
+
379
+
-`geojson` (string or object, required): GeoJSON object or JSON string to validate
380
+
381
+
**What it validates:**
382
+
383
+
- GeoJSON type validity (Feature, FeatureCollection, Point, LineString, Polygon, etc.)
-`statistics`: Object with type, feature count, geometry types, and bounding box
399
+
400
+
Each issue includes:
401
+
402
+
-`severity`: "error", "warning", or "info"
403
+
-`message`: Description of the issue
404
+
-`path`: JSON path to the problem (optional)
405
+
-`suggestion`: How to fix the issue (optional)
406
+
407
+
**Example:**
408
+
409
+
```json
410
+
{
411
+
"geojson": {
412
+
"type": "Feature",
413
+
"geometry": {
414
+
"type": "Point",
415
+
"coordinates": [102.0, 0.5]
416
+
},
417
+
"properties": {
418
+
"name": "Test Point"
419
+
}
420
+
}
421
+
}
422
+
```
423
+
424
+
**Returns:**
425
+
426
+
```json
427
+
{
428
+
"valid": true,
429
+
"errors": [],
430
+
"warnings": [],
431
+
"info": [],
432
+
"statistics": {
433
+
"type": "Feature",
434
+
"featureCount": 1,
435
+
"geometryTypes": ["Point"],
436
+
"bbox": [102.0, 0.5, 102.0, 0.5]
437
+
}
438
+
}
439
+
```
440
+
441
+
**Example prompts:**
442
+
443
+
- "Validate this GeoJSON file and tell me if there are any errors"
444
+
- "Check if my GeoJSON coordinates are valid"
445
+
- "Is this Feature Collection properly formatted?"
446
+
447
+
**Note:** This is an offline validation tool that doesn't require API access or token scopes.
448
+
449
+
#### Validate Expression tool
450
+
451
+
Validates Mapbox style expressions for syntax, operators, and argument correctness. This offline validation tool performs comprehensive checks on Mapbox expressions without requiring API access.
452
+
453
+
**Parameters:**
454
+
455
+
-`expression` (array or string, required): Mapbox expression to validate (array format or JSON string)
456
+
457
+
**What it validates:**
458
+
459
+
- Expression syntax and structure
460
+
- Valid operator names
461
+
- Correct argument counts for each operator
462
+
- Nested expression validation
463
+
- Expression depth (warns about deeply nested expressions)
464
+
465
+
**Returns:**
466
+
467
+
Validation results including:
468
+
469
+
-`valid` (boolean): Overall validity
470
+
-`errors` (array): Critical errors that make the expression invalid
- "Validate this Mapbox expression: [\"get\", \"population\"]"
527
+
- "Check if this interpolation expression is correct"
528
+
- "Is this expression syntax valid for Mapbox styles?"
529
+
530
+
**Note:** This is an offline validation tool that doesn't require API access or token scopes.
531
+
361
532
#### Coordinate Conversion tool
362
533
363
534
Convert coordinates between different coordinate reference systems (CRS), specifically between WGS84 (EPSG:4326) and Web Mercator (EPSG:3857).
@@ -514,6 +685,117 @@ A JSON object with:
514
685
- "Check color contrast for rgb(51, 51, 51) on rgb(245, 245, 245)"
515
686
- "Is this color combination accessible: foreground 'navy' on background 'lightblue'?"
516
687
688
+
#### compare_styles_tool
689
+
690
+
Compares two Mapbox styles and reports structural differences, including changes to layers, sources, and properties. This offline comparison tool performs deep object comparison without requiring API access.
691
+
692
+
**Parameters:**
693
+
694
+
-`styleA` (string or object, required): First Mapbox style to compare (JSON string or style object)
695
+
-`styleB` (string or object, required): Second Mapbox style to compare (JSON string or style object)
696
+
-`ignoreMetadata` (boolean, optional): If true, ignores metadata fields (id, owner, created, modified, draft, visibility) when comparing
697
+
698
+
**Comparison features:**
699
+
700
+
- Deep recursive comparison of nested structures
701
+
- Layer comparison by ID (not array position)
702
+
- Detailed diff reporting with JSON paths
703
+
- Identifies additions, removals, and modifications
704
+
- Optional metadata filtering
705
+
706
+
**Returns:**
707
+
708
+
```json
709
+
{
710
+
"identical": false,
711
+
"differences": [
712
+
{
713
+
"path": "layers.water.paint.fill-color",
714
+
"type": "modified",
715
+
"valueA": "#a0c8f0",
716
+
"valueB": "#b0d0ff",
717
+
"description": "Modified property at layers.water.paint.fill-color"
718
+
}
719
+
],
720
+
"summary": {
721
+
"totalDifferences": 1,
722
+
"added": 0,
723
+
"removed": 0,
724
+
"modified": 1
725
+
}
726
+
}
727
+
```
728
+
729
+
**Example prompts:**
730
+
731
+
- "Compare these two Mapbox styles and show me the differences"
732
+
- "What changed between my old style and new style?"
733
+
- "Compare styles ignoring metadata fields"
734
+
735
+
#### Style Optimization tool
736
+
737
+
Optimizes Mapbox styles by removing redundancies, simplifying expressions, and reducing file size.
738
+
739
+
**Parameters:**
740
+
741
+
-`style` (string or object, required): Mapbox style to optimize (JSON string or style object)
742
+
-`optimizations` (array, optional): Specific optimizations to apply. If not specified, all optimizations are applied. Available optimizations:
743
+
-`remove-unused-sources`: Remove sources not referenced by any layer
744
+
-`remove-duplicate-layers`: Remove layers that are exact duplicates
- "Optimize this Mapbox style to reduce its file size"
794
+
- "Remove unused sources from my style"
795
+
- "Simplify the expressions in this style"
796
+
- "Find and remove duplicate layers in my map style"
797
+
- "Optimize my style but only remove unused sources and empty layers"
798
+
517
799
## Agent Skills
518
800
519
801
This repository includes [Agent Skills](https://agentskills.io) that provide domain expertise for building maps with Mapbox. Skills teach AI assistants about map design, security best practices, and common implementation patterns.
0 commit comments