@mapbox/mcp-server 0.9.2-dev → 0.11.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.
- package/README.md +7 -4
- package/dist/commonjs/index.js +16 -10
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/resources/temporary/TemporaryDataResource.d.ts +2 -1
- package/dist/commonjs/resources/temporary/TemporaryDataResource.d.ts.map +1 -1
- package/dist/commonjs/resources/temporary/TemporaryDataResource.js +14 -1
- package/dist/commonjs/resources/temporary/TemporaryDataResource.js.map +1 -1
- package/dist/commonjs/tools/area-tool/AreaTool.input.schema.d.ts +2 -2
- package/dist/commonjs/tools/bearing-tool/BearingTool.output.schema.d.ts +2 -2
- package/dist/commonjs/tools/buffer-tool/BufferTool.input.schema.d.ts +2 -2
- package/dist/commonjs/tools/convex-tool/ConvexTool.d.ts +18 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.d.ts.map +1 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.input.schema.d.ts +25 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.input.schema.js +16 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.js +70 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.js.map +1 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.output.schema.d.ts +13 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.output.schema.js +14 -0
- package/dist/commonjs/tools/convex-tool/ConvexTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.d.ts +18 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.d.ts.map +1 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.input.schema.d.ts +34 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.input.schema.js +25 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.js +83 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.js.map +1 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.output.schema.d.ts +34 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.output.schema.js +18 -0
- package/dist/commonjs/tools/destination-tool/DestinationTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.d.ts +18 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.d.ts.map +1 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.input.schema.d.ts +13 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.input.schema.js +12 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.js +75 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.js.map +1 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.output.schema.d.ts +13 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.output.schema.js +16 -0
- package/dist/commonjs/tools/difference-tool/DifferenceTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/directions-tool/DirectionsTool.output.schema.d.ts +32 -32
- package/dist/commonjs/tools/distance-tool/DistanceTool.input.schema.d.ts +2 -2
- package/dist/commonjs/tools/distance-tool/DistanceTool.output.schema.d.ts +3 -3
- package/dist/commonjs/tools/intersect-tool/IntersectTool.d.ts +18 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.d.ts.map +1 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.input.schema.d.ts +13 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.input.schema.js +12 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.js +75 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.js.map +1 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.output.schema.d.ts +13 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.output.schema.js +14 -0
- package/dist/commonjs/tools/intersect-tool/IntersectTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/isochrone-tool/IsochroneTool.input.schema.d.ts +2 -2
- package/dist/commonjs/tools/length-tool/LengthTool.d.ts +18 -0
- package/dist/commonjs/tools/length-tool/LengthTool.d.ts.map +1 -0
- package/dist/commonjs/tools/length-tool/LengthTool.input.schema.d.ts +13 -0
- package/dist/commonjs/tools/length-tool/LengthTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/length-tool/LengthTool.input.schema.js +21 -0
- package/dist/commonjs/tools/length-tool/LengthTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/length-tool/LengthTool.js +69 -0
- package/dist/commonjs/tools/length-tool/LengthTool.js.map +1 -0
- package/dist/commonjs/tools/length-tool/LengthTool.output.schema.d.ts +16 -0
- package/dist/commonjs/tools/length-tool/LengthTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/length-tool/LengthTool.output.schema.js +14 -0
- package/dist/commonjs/tools/length-tool/LengthTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.d.ts +18 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.d.ts.map +1 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.d.ts +31 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.js +27 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.js +81 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.js.map +1 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.d.ts +34 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.js +20 -0
- package/dist/commonjs/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.d.ts +18 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.d.ts.map +1 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.input.schema.d.ts +46 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.input.schema.js +26 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.js +86 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.js.map +1 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.output.schema.d.ts +34 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.output.schema.js +18 -0
- package/dist/commonjs/tools/nearest-point-tool/NearestPointTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/optimization-tool/OptimizationTool.input.schema.d.ts +2 -2
- package/dist/commonjs/tools/point-in-polygon-tool/PointInPolygonTool.input.schema.d.ts +2 -2
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.d.ts +18 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.d.ts.map +1 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.d.ts +28 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.js +24 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.js +84 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.js.map +1 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.d.ts +31 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.js +17 -0
- package/dist/commonjs/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/reverse-geocode-tool/ReverseGeocodeTool.input.schema.d.ts +1 -1
- package/dist/commonjs/tools/reverse-geocode-tool/ReverseGeocodeTool.output.schema.d.ts +12 -12
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.d.ts.map +1 -1
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.d.ts +8 -8
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.js +70 -0
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.js.map +1 -1
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.d.ts +6 -6
- package/dist/commonjs/tools/shared/polygonSchema.d.ts +4 -0
- package/dist/commonjs/tools/shared/polygonSchema.d.ts.map +1 -0
- package/dist/commonjs/tools/shared/polygonSchema.js +15 -0
- package/dist/commonjs/tools/shared/polygonSchema.js.map +1 -0
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.input.schema.d.ts +12 -12
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.input.schema.d.ts.map +1 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.input.schema.js +2 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.input.schema.js.map +1 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js +30 -12
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
- package/dist/commonjs/tools/toolRegistry.d.ts +11 -2
- package/dist/commonjs/tools/toolRegistry.d.ts.map +1 -1
- package/dist/commonjs/tools/toolRegistry.js +18 -0
- package/dist/commonjs/tools/toolRegistry.js.map +1 -1
- package/dist/commonjs/tools/union-tool/UnionTool.d.ts +18 -0
- package/dist/commonjs/tools/union-tool/UnionTool.d.ts.map +1 -0
- package/dist/commonjs/tools/union-tool/UnionTool.input.schema.d.ts +10 -0
- package/dist/commonjs/tools/union-tool/UnionTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/union-tool/UnionTool.input.schema.js +14 -0
- package/dist/commonjs/tools/union-tool/UnionTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/union-tool/UnionTool.js +72 -0
- package/dist/commonjs/tools/union-tool/UnionTool.js.map +1 -0
- package/dist/commonjs/tools/union-tool/UnionTool.output.schema.d.ts +13 -0
- package/dist/commonjs/tools/union-tool/UnionTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/union-tool/UnionTool.output.schema.js +13 -0
- package/dist/commonjs/tools/union-tool/UnionTool.output.schema.js.map +1 -0
- package/dist/commonjs/utils/temporaryResourceManager.d.ts +16 -4
- package/dist/commonjs/utils/temporaryResourceManager.d.ts.map +1 -1
- package/dist/commonjs/utils/temporaryResourceManager.js +34 -3
- package/dist/commonjs/utils/temporaryResourceManager.js.map +1 -1
- package/dist/commonjs/version.json +3 -3
- package/dist/esm/index.js +16 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/temporary/TemporaryDataResource.d.ts +2 -1
- package/dist/esm/resources/temporary/TemporaryDataResource.d.ts.map +1 -1
- package/dist/esm/resources/temporary/TemporaryDataResource.js +14 -1
- package/dist/esm/resources/temporary/TemporaryDataResource.js.map +1 -1
- package/dist/esm/tools/area-tool/AreaTool.input.schema.d.ts +2 -2
- package/dist/esm/tools/bearing-tool/BearingTool.output.schema.d.ts +2 -2
- package/dist/esm/tools/buffer-tool/BufferTool.input.schema.d.ts +2 -2
- package/dist/esm/tools/convex-tool/ConvexTool.d.ts +18 -0
- package/dist/esm/tools/convex-tool/ConvexTool.d.ts.map +1 -0
- package/dist/esm/tools/convex-tool/ConvexTool.input.schema.d.ts +25 -0
- package/dist/esm/tools/convex-tool/ConvexTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/convex-tool/ConvexTool.input.schema.js +13 -0
- package/dist/esm/tools/convex-tool/ConvexTool.input.schema.js.map +1 -0
- package/dist/esm/tools/convex-tool/ConvexTool.js +66 -0
- package/dist/esm/tools/convex-tool/ConvexTool.js.map +1 -0
- package/dist/esm/tools/convex-tool/ConvexTool.output.schema.d.ts +13 -0
- package/dist/esm/tools/convex-tool/ConvexTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/convex-tool/ConvexTool.output.schema.js +11 -0
- package/dist/esm/tools/convex-tool/ConvexTool.output.schema.js.map +1 -0
- package/dist/esm/tools/destination-tool/DestinationTool.d.ts +18 -0
- package/dist/esm/tools/destination-tool/DestinationTool.d.ts.map +1 -0
- package/dist/esm/tools/destination-tool/DestinationTool.input.schema.d.ts +34 -0
- package/dist/esm/tools/destination-tool/DestinationTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/destination-tool/DestinationTool.input.schema.js +22 -0
- package/dist/esm/tools/destination-tool/DestinationTool.input.schema.js.map +1 -0
- package/dist/esm/tools/destination-tool/DestinationTool.js +79 -0
- package/dist/esm/tools/destination-tool/DestinationTool.js.map +1 -0
- package/dist/esm/tools/destination-tool/DestinationTool.output.schema.d.ts +34 -0
- package/dist/esm/tools/destination-tool/DestinationTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/destination-tool/DestinationTool.output.schema.js +15 -0
- package/dist/esm/tools/destination-tool/DestinationTool.output.schema.js.map +1 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.d.ts +18 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.d.ts.map +1 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.input.schema.d.ts +13 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.input.schema.js +9 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.input.schema.js.map +1 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.js +71 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.js.map +1 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.output.schema.d.ts +13 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.output.schema.js +13 -0
- package/dist/esm/tools/difference-tool/DifferenceTool.output.schema.js.map +1 -0
- package/dist/esm/tools/directions-tool/DirectionsTool.output.schema.d.ts +32 -32
- package/dist/esm/tools/distance-tool/DistanceTool.input.schema.d.ts +2 -2
- package/dist/esm/tools/distance-tool/DistanceTool.output.schema.d.ts +3 -3
- package/dist/esm/tools/intersect-tool/IntersectTool.d.ts +18 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.d.ts.map +1 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.input.schema.d.ts +13 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.input.schema.js +9 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.input.schema.js.map +1 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.js +71 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.js.map +1 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.output.schema.d.ts +13 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.output.schema.js +11 -0
- package/dist/esm/tools/intersect-tool/IntersectTool.output.schema.js.map +1 -0
- package/dist/esm/tools/isochrone-tool/IsochroneTool.input.schema.d.ts +2 -2
- package/dist/esm/tools/length-tool/LengthTool.d.ts +18 -0
- package/dist/esm/tools/length-tool/LengthTool.d.ts.map +1 -0
- package/dist/esm/tools/length-tool/LengthTool.input.schema.d.ts +13 -0
- package/dist/esm/tools/length-tool/LengthTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/length-tool/LengthTool.input.schema.js +18 -0
- package/dist/esm/tools/length-tool/LengthTool.input.schema.js.map +1 -0
- package/dist/esm/tools/length-tool/LengthTool.js +65 -0
- package/dist/esm/tools/length-tool/LengthTool.js.map +1 -0
- package/dist/esm/tools/length-tool/LengthTool.output.schema.d.ts +16 -0
- package/dist/esm/tools/length-tool/LengthTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/length-tool/LengthTool.output.schema.js +11 -0
- package/dist/esm/tools/length-tool/LengthTool.output.schema.js.map +1 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.d.ts +18 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.d.ts.map +1 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.d.ts +31 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.js +24 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.input.schema.js.map +1 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.js +77 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.js.map +1 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.d.ts +34 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.js +17 -0
- package/dist/esm/tools/nearest-point-on-line-tool/NearestPointOnLineTool.output.schema.js.map +1 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.d.ts +18 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.d.ts.map +1 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.input.schema.d.ts +46 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.input.schema.js +23 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.input.schema.js.map +1 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.js +82 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.js.map +1 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.output.schema.d.ts +34 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.output.schema.js +15 -0
- package/dist/esm/tools/nearest-point-tool/NearestPointTool.output.schema.js.map +1 -0
- package/dist/esm/tools/optimization-tool/OptimizationTool.input.schema.d.ts +2 -2
- package/dist/esm/tools/point-in-polygon-tool/PointInPolygonTool.input.schema.d.ts +2 -2
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.d.ts +18 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.d.ts.map +1 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.d.ts +28 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.js +21 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.input.schema.js.map +1 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.js +80 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.js.map +1 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.d.ts +31 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.js +14 -0
- package/dist/esm/tools/points-within-polygon-tool/PointsWithinPolygonTool.output.schema.js.map +1 -0
- package/dist/esm/tools/reverse-geocode-tool/ReverseGeocodeTool.input.schema.d.ts +1 -1
- package/dist/esm/tools/reverse-geocode-tool/ReverseGeocodeTool.output.schema.d.ts +12 -12
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.d.ts.map +1 -1
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.d.ts +8 -8
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.js +70 -0
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.js.map +1 -1
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.d.ts +6 -6
- package/dist/esm/tools/shared/polygonSchema.d.ts +4 -0
- package/dist/esm/tools/shared/polygonSchema.d.ts.map +1 -0
- package/dist/esm/tools/shared/polygonSchema.js +12 -0
- package/dist/esm/tools/shared/polygonSchema.js.map +1 -0
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.input.schema.d.ts +12 -12
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.input.schema.d.ts.map +1 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.input.schema.js +2 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.input.schema.js.map +1 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js +31 -13
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
- package/dist/esm/tools/toolRegistry.d.ts +11 -2
- package/dist/esm/tools/toolRegistry.d.ts.map +1 -1
- package/dist/esm/tools/toolRegistry.js +18 -0
- package/dist/esm/tools/toolRegistry.js.map +1 -1
- package/dist/esm/tools/union-tool/UnionTool.d.ts +18 -0
- package/dist/esm/tools/union-tool/UnionTool.d.ts.map +1 -0
- package/dist/esm/tools/union-tool/UnionTool.input.schema.d.ts +10 -0
- package/dist/esm/tools/union-tool/UnionTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/union-tool/UnionTool.input.schema.js +11 -0
- package/dist/esm/tools/union-tool/UnionTool.input.schema.js.map +1 -0
- package/dist/esm/tools/union-tool/UnionTool.js +68 -0
- package/dist/esm/tools/union-tool/UnionTool.js.map +1 -0
- package/dist/esm/tools/union-tool/UnionTool.output.schema.d.ts +13 -0
- package/dist/esm/tools/union-tool/UnionTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/union-tool/UnionTool.output.schema.js +10 -0
- package/dist/esm/tools/union-tool/UnionTool.output.schema.js.map +1 -0
- package/dist/esm/utils/temporaryResourceManager.d.ts +16 -4
- package/dist/esm/utils/temporaryResourceManager.d.ts.map +1 -1
- package/dist/esm/utils/temporaryResourceManager.js +34 -3
- package/dist/esm/utils/temporaryResourceManager.js.map +1 -1
- package/dist/esm/version.json +3 -3
- package/package.json +2 -2
- package/patches/@modelcontextprotocol+sdk+1.29.0.patch +62 -0
- package/patches/@modelcontextprotocol+sdk+1.27.1.patch +0 -33
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Mapbox, Inc.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { randomUUID, randomBytes } from 'node:crypto';
|
|
4
4
|
import { createUIResource } from '@mcp-ui/server';
|
|
5
5
|
import { MapboxApiBasedTool } from '../MapboxApiBasedTool.js';
|
|
6
6
|
import { StaticMapImageInputSchema } from './StaticMapImageTool.input.schema.js';
|
|
7
7
|
import { isMcpUiEnabled } from '../../config/toolConfig.js';
|
|
8
|
+
import { temporaryResourceManager } from '../../utils/temporaryResourceManager.js';
|
|
9
|
+
// Images larger than this threshold are stored as temporary resources instead
|
|
10
|
+
// of being inlined as base64, to avoid exceeding Claude Desktop's 1MB tool
|
|
11
|
+
// result limit. base64 adds ~33% overhead, so 700KB raw ≈ 933KB encoded.
|
|
12
|
+
const IMAGE_INLINE_THRESHOLD = 700 * 1024; // 700KB
|
|
8
13
|
export class StaticMapImageTool extends MapboxApiBasedTool {
|
|
9
14
|
name = 'static_map_image_tool';
|
|
10
15
|
description = 'Generates a static map image from Mapbox Static Images API. Supports center coordinates, zoom level (0-22), image size (up to 1280x1280), various Mapbox styles, and overlays (markers, paths, GeoJSON). Returns PNG for vector styles, JPEG for raster-only styles.';
|
|
@@ -82,8 +87,13 @@ export class StaticMapImageTool extends MapboxApiBasedTool {
|
|
|
82
87
|
overlayString = encodedOverlays.join(',') + '/';
|
|
83
88
|
}
|
|
84
89
|
const density = input.highDensity ? '@2x' : '';
|
|
85
|
-
const
|
|
86
|
-
|
|
90
|
+
const encodedStyle = input.style
|
|
91
|
+
.split('/')
|
|
92
|
+
.map(encodeURIComponent)
|
|
93
|
+
.join('/');
|
|
94
|
+
const publicUrl = `${MapboxApiBasedTool.mapboxApiEndpoint}styles/v1/${encodedStyle}/static/${overlayString}${lng},${lat},${input.zoom}/${width}x${height}${density}`;
|
|
95
|
+
const url = `${publicUrl}?access_token=${accessToken}`;
|
|
96
|
+
// Fetch image
|
|
87
97
|
const response = await this.httpRequest(url);
|
|
88
98
|
if (!response.ok) {
|
|
89
99
|
const errorMessage = await this.getErrorMessage(response);
|
|
@@ -93,21 +103,29 @@ export class StaticMapImageTool extends MapboxApiBasedTool {
|
|
|
93
103
|
};
|
|
94
104
|
}
|
|
95
105
|
const buffer = await response.arrayBuffer();
|
|
96
|
-
const base64Data = Buffer.from(buffer).toString('base64');
|
|
97
106
|
const isRasterStyle = input.style.includes('satellite');
|
|
98
107
|
const mimeType = isRasterStyle ? 'image/jpeg' : 'image/png';
|
|
99
108
|
// content[0] MUST be the URL text — MCP Apps UI finds it via content.find(c => c.type === 'text')
|
|
109
|
+
// Use public URL (without credentials) to avoid leaking the access token
|
|
100
110
|
const content = [
|
|
101
|
-
{
|
|
102
|
-
type: 'text',
|
|
103
|
-
text: url
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
type: 'image',
|
|
107
|
-
data: base64Data,
|
|
108
|
-
mimeType
|
|
109
|
-
}
|
|
111
|
+
{ type: 'text', text: publicUrl }
|
|
110
112
|
];
|
|
113
|
+
if (buffer.byteLength > IMAGE_INLINE_THRESHOLD) {
|
|
114
|
+
// Image is too large to inline safely — store as temporary resource
|
|
115
|
+
const resourceId = randomBytes(16).toString('hex');
|
|
116
|
+
const resourceUri = `mapbox://temp/static-map-${resourceId}`;
|
|
117
|
+
const base64Data = Buffer.from(buffer).toString('base64');
|
|
118
|
+
temporaryResourceManager.create(resourceId, resourceUri, base64Data, { toolName: this.name, size: buffer.byteLength }, undefined, mimeType);
|
|
119
|
+
content.push({
|
|
120
|
+
type: 'text',
|
|
121
|
+
text: `⚠️ Image (${Math.round(buffer.byteLength / 1024)}KB) stored as temporary resource.\nResource URI: ${resourceUri}\nTTL: 30 minutes`
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
// Image is small enough to inline as base64
|
|
126
|
+
const base64Data = Buffer.from(buffer).toString('base64');
|
|
127
|
+
content.push({ type: 'image', data: base64Data, mimeType });
|
|
128
|
+
}
|
|
111
129
|
// Conditionally add MCP-UI resource if enabled (backward compatibility)
|
|
112
130
|
if (isMcpUiEnabled()) {
|
|
113
131
|
const uiResource = createUIResource({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticMapImageTool.js","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"StaticMapImageTool.js","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAGjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,8EAA8E;AAC9E,2EAA2E;AAC3E,yEAAyE;AACzE,MAAM,sBAAsB,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,QAAQ;AAEnD,MAAM,OAAO,kBAAmB,SAAQ,kBAEvC;IACC,IAAI,GAAG,uBAAuB,CAAC;IAC/B,WAAW,GACT,sQAAsQ,CAAC;IACzQ,WAAW,GAAG;QACZ,KAAK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B,KAAK,CAAC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE;gBACxE,OAAO,EAAE;oBACP,IAAI,EAAE,aAAa;oBACnB,SAAS,EAAE,GAAG;iBACf;gBACD,QAAQ,EAAE,MAAM;gBAChB,UAAU,EAAE;oBACV,sBAAsB,EAAE,CAAC,GAAG,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC;iBACtD;aACF,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO;YACL,OAAO;YACP,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACL,QAAQ,EAAE,UAAU,EAAE;aACvB;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { PointsWithinPolygonTool } from './points-within-polygon-tool/PointsWithinPolygonTool.js';
|
|
2
|
+
import { UnionTool } from './union-tool/UnionTool.js';
|
|
3
|
+
import { NearestPointTool } from './nearest-point-tool/NearestPointTool.js';
|
|
4
|
+
import { IntersectTool } from './intersect-tool/IntersectTool.js';
|
|
5
|
+
import { DifferenceTool } from './difference-tool/DifferenceTool.js';
|
|
6
|
+
import { DestinationTool } from './destination-tool/DestinationTool.js';
|
|
7
|
+
import { LengthTool } from './length-tool/LengthTool.js';
|
|
8
|
+
import { NearestPointOnLineTool } from './nearest-point-on-line-tool/NearestPointOnLineTool.js';
|
|
9
|
+
import { ConvexTool } from './convex-tool/ConvexTool.js';
|
|
1
10
|
import { PlaceDetailsTool } from './place-details-tool/PlaceDetailsTool.js';
|
|
2
11
|
import { SimplifyTool } from './simplify-tool/SimplifyTool.js';
|
|
3
12
|
import { BoundingBoxTool } from './bounding-box-tool/BoundingBoxTool.js';
|
|
@@ -23,7 +32,7 @@ import { SearchAndGeocodeTool } from './search-and-geocode-tool/SearchAndGeocode
|
|
|
23
32
|
* Core tools that work in all MCP clients without requiring special capabilities
|
|
24
33
|
* These tools are registered immediately during server startup
|
|
25
34
|
*/
|
|
26
|
-
export declare const CORE_TOOLS: readonly [PlaceDetailsTool, SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool];
|
|
35
|
+
export declare const CORE_TOOLS: readonly [PointsWithinPolygonTool, UnionTool, NearestPointTool, IntersectTool, DifferenceTool, DestinationTool, LengthTool, NearestPointOnLineTool, ConvexTool, PlaceDetailsTool, SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool];
|
|
27
36
|
/**
|
|
28
37
|
* Tools that require elicitation capability for optimal functionality
|
|
29
38
|
* These tools use elicitInput() for secure token management
|
|
@@ -53,7 +62,7 @@ export declare const RESOURCE_FALLBACK_TOOLS: readonly [ResourceReaderTool, Cate
|
|
|
53
62
|
/**
|
|
54
63
|
* All tools combined (for backward compatibility and testing)
|
|
55
64
|
*/
|
|
56
|
-
export declare const ALL_TOOLS: readonly [PlaceDetailsTool, SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool, ResourceReaderTool, CategoryListTool];
|
|
65
|
+
export declare const ALL_TOOLS: readonly [PointsWithinPolygonTool, UnionTool, NearestPointTool, IntersectTool, DifferenceTool, DestinationTool, LengthTool, NearestPointOnLineTool, ConvexTool, PlaceDetailsTool, SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool, ResourceReaderTool, CategoryListTool];
|
|
57
66
|
export type ToolInstance = (typeof ALL_TOOLS)[number];
|
|
58
67
|
/**
|
|
59
68
|
* Get all tools (for backward compatibility)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRegistry.d.ts","sourceRoot":"","sources":["../../../src/tools/toolRegistry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,gBAAgB,E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I,SAAS,YAAY,EAAE,CAElE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEpE"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Mapbox, Inc.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
// INSERT NEW TOOL IMPORT HERE
|
|
4
|
+
import { PointsWithinPolygonTool } from './points-within-polygon-tool/PointsWithinPolygonTool.js';
|
|
5
|
+
import { UnionTool } from './union-tool/UnionTool.js';
|
|
6
|
+
import { NearestPointTool } from './nearest-point-tool/NearestPointTool.js';
|
|
7
|
+
import { IntersectTool } from './intersect-tool/IntersectTool.js';
|
|
8
|
+
import { DifferenceTool } from './difference-tool/DifferenceTool.js';
|
|
9
|
+
import { DestinationTool } from './destination-tool/DestinationTool.js';
|
|
10
|
+
import { LengthTool } from './length-tool/LengthTool.js';
|
|
11
|
+
import { NearestPointOnLineTool } from './nearest-point-on-line-tool/NearestPointOnLineTool.js';
|
|
12
|
+
import { ConvexTool } from './convex-tool/ConvexTool.js';
|
|
4
13
|
import { PlaceDetailsTool } from './place-details-tool/PlaceDetailsTool.js';
|
|
5
14
|
import { SimplifyTool } from './simplify-tool/SimplifyTool.js';
|
|
6
15
|
import { BoundingBoxTool } from './bounding-box-tool/BoundingBoxTool.js';
|
|
@@ -29,6 +38,15 @@ import { httpRequest } from '../utils/httpPipeline.js';
|
|
|
29
38
|
*/
|
|
30
39
|
export const CORE_TOOLS = [
|
|
31
40
|
// INSERT NEW TOOL INSTANCE HERE
|
|
41
|
+
new PointsWithinPolygonTool(),
|
|
42
|
+
new UnionTool(),
|
|
43
|
+
new NearestPointTool(),
|
|
44
|
+
new IntersectTool(),
|
|
45
|
+
new DifferenceTool(),
|
|
46
|
+
new DestinationTool(),
|
|
47
|
+
new LengthTool(),
|
|
48
|
+
new NearestPointOnLineTool(),
|
|
49
|
+
new ConvexTool(),
|
|
32
50
|
new PlaceDetailsTool({ httpRequest }),
|
|
33
51
|
new SimplifyTool(),
|
|
34
52
|
new BoundingBoxTool(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRegistry.js","sourceRoot":"","sources":["../../../src/tools/toolRegistry.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE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IAC1B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseTool } from '../BaseTool.js';
|
|
2
|
+
import { UnionInputSchema } from './UnionTool.input.schema.js';
|
|
3
|
+
import { UnionOutputSchema } from './UnionTool.output.schema.js';
|
|
4
|
+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
export declare class UnionTool extends BaseTool<typeof UnionInputSchema, typeof UnionOutputSchema> {
|
|
6
|
+
readonly name = "union_tool";
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly annotations: {
|
|
9
|
+
title: string;
|
|
10
|
+
readOnlyHint: boolean;
|
|
11
|
+
destructiveHint: boolean;
|
|
12
|
+
idempotentHint: boolean;
|
|
13
|
+
openWorldHint: boolean;
|
|
14
|
+
};
|
|
15
|
+
constructor();
|
|
16
|
+
run(rawInput: unknown): Promise<CallToolResult>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=UnionTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/union-tool/UnionTool.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,iBAAiB,EAElB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,qBAAa,SAAU,SAAQ,QAAQ,CACrC,OAAO,gBAAgB,EACvB,OAAO,iBAAiB,CACzB;IACC,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,SAIiB;IAErC,QAAQ,CAAC,WAAW;;;;;;MAMlB;;IAMI,GAAG,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;CAmDtD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UnionInputSchema: z.ZodObject<{
|
|
3
|
+
polygons: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">, "many">;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
polygons: number[][][][];
|
|
6
|
+
}, {
|
|
7
|
+
polygons: number[][][][];
|
|
8
|
+
}>;
|
|
9
|
+
export type UnionInput = z.infer<typeof UnionInputSchema>;
|
|
10
|
+
//# sourceMappingURL=UnionTool.input.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionTool.input.schema.d.ts","sourceRoot":"","sources":["../../../../src/tools/union-tool/UnionTool.input.schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;EAK3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { PolygonSchema } from '../shared/polygonSchema.js';
|
|
5
|
+
export const UnionInputSchema = z.object({
|
|
6
|
+
polygons: z
|
|
7
|
+
.array(PolygonSchema)
|
|
8
|
+
.min(2)
|
|
9
|
+
.describe('Array of polygons to merge into a single union geometry')
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=UnionTool.input.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionTool.input.schema.js","sourceRoot":"","sources":["../../../../src/tools/union-tool/UnionTool.input.schema.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,CAAC;SACR,KAAK,CAAC,aAAa,CAAC;SACpB,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,yDAAyD,CAAC;CACvE,CAAC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { union, polygon, featureCollection } from '@turf/turf';
|
|
4
|
+
import { context, SpanStatusCode, trace } from '@opentelemetry/api';
|
|
5
|
+
import { createLocalToolExecutionContext } from '../../utils/tracing.js';
|
|
6
|
+
import { BaseTool } from '../BaseTool.js';
|
|
7
|
+
import { UnionInputSchema } from './UnionTool.input.schema.js';
|
|
8
|
+
import { UnionOutputSchema } from './UnionTool.output.schema.js';
|
|
9
|
+
export class UnionTool extends BaseTool {
|
|
10
|
+
name = 'union_tool';
|
|
11
|
+
description = 'Merge two or more polygons into a single unified geometry. ' +
|
|
12
|
+
'Useful for combining service areas, delivery zones, isochrones, or coverage regions. ' +
|
|
13
|
+
'Returns a Polygon or MultiPolygon if the inputs do not overlap. ' +
|
|
14
|
+
'Works offline without API calls.';
|
|
15
|
+
annotations = {
|
|
16
|
+
title: 'Union Polygons',
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
destructiveHint: false,
|
|
19
|
+
idempotentHint: true,
|
|
20
|
+
openWorldHint: false
|
|
21
|
+
};
|
|
22
|
+
constructor() {
|
|
23
|
+
super({ inputSchema: UnionInputSchema, outputSchema: UnionOutputSchema });
|
|
24
|
+
}
|
|
25
|
+
async run(rawInput) {
|
|
26
|
+
const toolContext = createLocalToolExecutionContext(this.name, 0);
|
|
27
|
+
return await context.with(trace.setSpan(context.active(), toolContext.span), async () => {
|
|
28
|
+
try {
|
|
29
|
+
const input = UnionInputSchema.parse(rawInput);
|
|
30
|
+
const polys = input.polygons.map((rings) => polygon(rings));
|
|
31
|
+
// Union all polygons by passing them as a FeatureCollection
|
|
32
|
+
const merged = union(featureCollection(polys));
|
|
33
|
+
if (!merged)
|
|
34
|
+
throw new Error('Union operation returned null');
|
|
35
|
+
const output = {
|
|
36
|
+
geometry: merged.geometry,
|
|
37
|
+
type: merged.geometry.type
|
|
38
|
+
};
|
|
39
|
+
const validated = this.validateOutput(output);
|
|
40
|
+
const text = `Union of ${input.polygons.length} polygons computed.\n` +
|
|
41
|
+
`Result type: ${validated.type}\n` +
|
|
42
|
+
`GeoJSON geometry:\n${JSON.stringify(validated.geometry, null, 2)}`;
|
|
43
|
+
toolContext.span.setStatus({ code: SpanStatusCode.OK });
|
|
44
|
+
toolContext.span.end();
|
|
45
|
+
return {
|
|
46
|
+
content: [{ type: 'text', text }],
|
|
47
|
+
structuredContent: validated,
|
|
48
|
+
isError: false
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
53
|
+
toolContext.span.setStatus({
|
|
54
|
+
code: SpanStatusCode.ERROR,
|
|
55
|
+
message: errorMessage
|
|
56
|
+
});
|
|
57
|
+
toolContext.span.end();
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{ type: 'text', text: `UnionTool: ${errorMessage}` }
|
|
61
|
+
],
|
|
62
|
+
isError: true
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=UnionTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionTool.js","sourceRoot":"","sources":["../../../../src/tools/union-tool/UnionTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,iBAAiB,EAElB,MAAM,8BAA8B,CAAC;AAGtC,MAAM,OAAO,SAAU,SAAQ,QAG9B;IACU,IAAI,GAAG,YAAY,CAAC;IACpB,WAAW,GAClB,6DAA6D;QAC7D,uFAAuF;QACvF,kEAAkE;QAClE,kCAAkC,CAAC;IAE5B,WAAW,GAAG;QACrB,KAAK,EAAE,gBAAgB;QACvB,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;KACrB,CAAC;IAEF;QACE,KAAK,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,QAAiB;QACzB,MAAM,WAAW,GAAG,+BAA+B,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAClE,OAAO,MAAM,OAAO,CAAC,IAAI,CACvB,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,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YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACzD,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC;oBACzB,IAAI,EAAE,cAAc,CAAC,KAAK;oBAC1B,OAAO,EAAE,YAAY;iBACtB,CAAC,CAAC;gBACH,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE;wBACP,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,cAAc,YAAY,EAAE,EAAE;qBAC9D;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UnionOutputSchema: z.ZodObject<{
|
|
3
|
+
geometry: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
4
|
+
type: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: string;
|
|
7
|
+
geometry: Record<string, unknown>;
|
|
8
|
+
}, {
|
|
9
|
+
type: string;
|
|
10
|
+
geometry: Record<string, unknown>;
|
|
11
|
+
}>;
|
|
12
|
+
export type UnionOutput = z.infer<typeof UnionOutputSchema>;
|
|
13
|
+
//# sourceMappingURL=UnionTool.output.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionTool.output.schema.d.ts","sourceRoot":"","sources":["../../../../src/tools/union-tool/UnionTool.output.schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;EAO5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export const UnionOutputSchema = z.object({
|
|
5
|
+
geometry: z
|
|
6
|
+
.record(z.unknown())
|
|
7
|
+
.describe('GeoJSON geometry of the merged polygon (Polygon or MultiPolygon)'),
|
|
8
|
+
type: z.string().describe('Geometry type: Polygon or MultiPolygon')
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=UnionTool.output.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionTool.output.schema.js","sourceRoot":"","sources":["../../../../src/tools/union-tool/UnionTool.output.schema.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,QAAQ,EAAE,CAAC;SACR,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,QAAQ,CACP,kEAAkE,CACnE;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CACpE,CAAC,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Manager for temporary resources created from large tool responses.
|
|
3
|
-
* Resources are stored in-memory with configurable TTL
|
|
3
|
+
* Resources are stored in-memory with configurable TTL and a total byte cap
|
|
4
|
+
* to prevent unbounded memory growth. When the cap is exceeded, the oldest
|
|
5
|
+
* entries are evicted first.
|
|
4
6
|
*/
|
|
5
7
|
export interface TemporaryResource {
|
|
6
8
|
id: string;
|
|
7
9
|
uri: string;
|
|
8
10
|
data: unknown;
|
|
11
|
+
mimeType?: string;
|
|
12
|
+
byteSize: number;
|
|
9
13
|
created: number;
|
|
10
14
|
ttl: number;
|
|
11
15
|
metadata?: {
|
|
@@ -15,13 +19,17 @@ export interface TemporaryResource {
|
|
|
15
19
|
}
|
|
16
20
|
export declare class TemporaryResourceManager {
|
|
17
21
|
private defaultTTL;
|
|
22
|
+
private maxBytes;
|
|
18
23
|
private resources;
|
|
19
24
|
private cleanupInterval?;
|
|
20
|
-
|
|
25
|
+
private totalBytes;
|
|
26
|
+
constructor(defaultTTL?: number, // 30 minutes
|
|
27
|
+
maxBytes?: number);
|
|
21
28
|
/**
|
|
22
|
-
* Create a temporary resource
|
|
29
|
+
* Create a temporary resource. Evicts oldest entries if the byte cap would
|
|
30
|
+
* be exceeded.
|
|
23
31
|
*/
|
|
24
|
-
create(id: string, uri: string, data: unknown, metadata?: TemporaryResource['metadata'], ttl?: number): TemporaryResource;
|
|
32
|
+
create(id: string, uri: string, data: unknown, metadata?: TemporaryResource['metadata'], ttl?: number, mimeType?: string): TemporaryResource;
|
|
25
33
|
/**
|
|
26
34
|
* Get a resource by URI
|
|
27
35
|
*/
|
|
@@ -38,6 +46,10 @@ export declare class TemporaryResourceManager {
|
|
|
38
46
|
* Get count of active resources
|
|
39
47
|
*/
|
|
40
48
|
count(): number;
|
|
49
|
+
/**
|
|
50
|
+
* Get total bytes currently stored
|
|
51
|
+
*/
|
|
52
|
+
totalBytesStored(): number;
|
|
41
53
|
/**
|
|
42
54
|
* Clear all resources
|
|
43
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporaryResourceManager.d.ts","sourceRoot":"","sources":["../../../src/utils/temporaryResourceManager.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"temporaryResourceManager.d.ts","sourceRoot":"","sources":["../../../src/utils/temporaryResourceManager.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IA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Bytes = 0;
|
|
9
|
+
constructor(defaultTTL = 30 * 60 * 1000, // 30 minutes
|
|
10
|
+
maxBytes = 50 * 1024 * 1024 // 50MB
|
|
8
11
|
) {
|
|
9
12
|
this.defaultTTL = defaultTTL;
|
|
13
|
+
this.maxBytes = maxBytes;
|
|
10
14
|
// Run cleanup every 5 minutes
|
|
11
15
|
this.cleanupInterval = setInterval(() => this.cleanup(), 5 * 60 * 1000);
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
|
-
* Create a temporary resource
|
|
18
|
+
* Create a temporary resource. Evicts oldest entries if the byte cap would
|
|
19
|
+
* be exceeded.
|
|
15
20
|
*/
|
|
16
|
-
create(id, uri, data, metadata, ttl) {
|
|
21
|
+
create(id, uri, data, metadata, ttl, mimeType) {
|
|
22
|
+
const dataStr = typeof data === 'string' ? data : JSON.stringify(data);
|
|
23
|
+
const byteSize = Buffer.byteLength(dataStr, 'utf8');
|
|
24
|
+
// Evict oldest entries until we have room
|
|
25
|
+
while (this.totalBytes + byteSize > this.maxBytes &&
|
|
26
|
+
this.resources.size > 0) {
|
|
27
|
+
const oldestUri = this.resources.keys().next().value;
|
|
28
|
+
const oldest = this.resources.get(oldestUri);
|
|
29
|
+
this.resources.delete(oldestUri);
|
|
30
|
+
this.totalBytes -= oldest.byteSize;
|
|
31
|
+
}
|
|
17
32
|
const resource = {
|
|
18
33
|
id,
|
|
19
34
|
uri,
|
|
20
35
|
data,
|
|
36
|
+
mimeType,
|
|
37
|
+
byteSize,
|
|
21
38
|
created: Date.now(),
|
|
22
39
|
ttl: ttl ?? this.defaultTTL,
|
|
23
40
|
metadata
|
|
24
41
|
};
|
|
25
42
|
this.resources.set(uri, resource);
|
|
43
|
+
this.totalBytes += byteSize;
|
|
26
44
|
return resource;
|
|
27
45
|
}
|
|
28
46
|
/**
|
|
@@ -36,6 +54,7 @@ export class TemporaryResourceManager {
|
|
|
36
54
|
// Check if expired
|
|
37
55
|
if (Date.now() - resource.created > resource.ttl) {
|
|
38
56
|
this.resources.delete(uri);
|
|
57
|
+
this.totalBytes -= resource.byteSize;
|
|
39
58
|
return undefined;
|
|
40
59
|
}
|
|
41
60
|
return resource;
|
|
@@ -44,6 +63,10 @@ export class TemporaryResourceManager {
|
|
|
44
63
|
* Delete a resource
|
|
45
64
|
*/
|
|
46
65
|
delete(uri) {
|
|
66
|
+
const resource = this.resources.get(uri);
|
|
67
|
+
if (resource) {
|
|
68
|
+
this.totalBytes -= resource.byteSize;
|
|
69
|
+
}
|
|
47
70
|
return this.resources.delete(uri);
|
|
48
71
|
}
|
|
49
72
|
/**
|
|
@@ -55,6 +78,7 @@ export class TemporaryResourceManager {
|
|
|
55
78
|
for (const [uri, resource] of this.resources.entries()) {
|
|
56
79
|
if (now - resource.created > resource.ttl) {
|
|
57
80
|
this.resources.delete(uri);
|
|
81
|
+
this.totalBytes -= resource.byteSize;
|
|
58
82
|
cleaned++;
|
|
59
83
|
}
|
|
60
84
|
}
|
|
@@ -66,11 +90,18 @@ export class TemporaryResourceManager {
|
|
|
66
90
|
count() {
|
|
67
91
|
return this.resources.size;
|
|
68
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Get total bytes currently stored
|
|
95
|
+
*/
|
|
96
|
+
totalBytesStored() {
|
|
97
|
+
return this.totalBytes;
|
|
98
|
+
}
|
|
69
99
|
/**
|
|
70
100
|
* Clear all resources
|
|
71
101
|
*/
|
|
72
102
|
clear() {
|
|
73
103
|
this.resources.clear();
|
|
104
|
+
this.totalBytes = 0;
|
|
74
105
|
}
|
|
75
106
|
/**
|
|
76
107
|
* Stop cleanup interval
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporaryResourceManager.js","sourceRoot":"","sources":["../../../src/utils/temporaryResourceManager.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;
|
|
1
|
+
{"version":3,"file":"temporaryResourceManager.js","sourceRoot":"","sources":["../../../src/utils/temporaryResourceManager.ts"],"names":[],"mappings":"AAAA,6BA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;QACvB,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;YACvD,IAAI,GAAG,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;gBAC1C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC3B,IAAI,CAAC,UAAU,IAAI,QAAQ,CAAC,QAAQ,CAAC;gBACrC,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACpC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF;AAED,qBAAqB;AACrB,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapbox/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Mapbox MCP server.",
|
|
5
5
|
"mcpName": "io.github.mapbox/mcp-server",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@mcp-ui/server": "^6.1.0",
|
|
80
80
|
"@modelcontextprotocol/ext-apps": "^1.1.1",
|
|
81
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
81
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
82
82
|
"@opentelemetry/api": "^1.9.0",
|
|
83
83
|
"@opentelemetry/auto-instrumentations-node": "^0.56.0",
|
|
84
84
|
"@opentelemetry/exporter-trace-otlp-http": "^0.56.0",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
--- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js
|
|
2
|
+
+++ b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js
|
|
3
|
+
@@ -197,15 +197,20 @@
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
if (!result.structuredContent) {
|
|
7
|
+
- throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`);
|
|
8
|
+
+ // Log warning but don't throw - allow tools to omit structured content
|
|
9
|
+
+ console.warn(`[MCP SDK Patch] Output validation warning: Tool ${toolName} has an output schema but no structured content was provided`);
|
|
10
|
+
}
|
|
11
|
+
- // if the tool has an output schema, validate structured content
|
|
12
|
+
- const outputObj = (0, zod_compat_js_1.normalizeObjectSchema)(tool.outputSchema);
|
|
13
|
+
- const parseResult = await (0, zod_compat_js_1.safeParseAsync)(outputObj, result.structuredContent);
|
|
14
|
+
- if (!parseResult.success) {
|
|
15
|
+
- const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
|
|
16
|
+
- const errorMessage = (0, zod_compat_js_1.getParseErrorMessage)(error);
|
|
17
|
+
- throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${errorMessage}`);
|
|
18
|
+
+ else {
|
|
19
|
+
+ // if the tool has an output schema, validate structured content
|
|
20
|
+
+ const outputObj = (0, zod_compat_js_1.normalizeObjectSchema)(tool.outputSchema);
|
|
21
|
+
+ const parseResult = await (0, zod_compat_js_1.safeParseAsync)(outputObj, result.structuredContent);
|
|
22
|
+
+ if (!parseResult.success) {
|
|
23
|
+
+ const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
|
|
24
|
+
+ const errorMessage = (0, zod_compat_js_1.getParseErrorMessage)(error);
|
|
25
|
+
+ // Log warning but don't throw - allow schema mismatches
|
|
26
|
+
+ console.warn(`[MCP SDK Patch] Output validation warning: Invalid structured content for tool ${toolName}: ${errorMessage}`);
|
|
27
|
+
+ // Keep the structuredContent despite validation failure
|
|
28
|
+
+ }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
--- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
33
|
+
+++ b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
34
|
+
@@ -194,15 +194,20 @@
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!result.structuredContent) {
|
|
38
|
+
- throw new McpError(ErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`);
|
|
39
|
+
+ // Log warning but don't throw - allow tools to omit structured content
|
|
40
|
+
+ console.warn(`[MCP SDK Patch] Output validation warning: Tool ${toolName} has an output schema but no structured content was provided`);
|
|
41
|
+
}
|
|
42
|
+
- // if the tool has an output schema, validate structured content
|
|
43
|
+
- const outputObj = normalizeObjectSchema(tool.outputSchema);
|
|
44
|
+
- const parseResult = await safeParseAsync(outputObj, result.structuredContent);
|
|
45
|
+
- if (!parseResult.success) {
|
|
46
|
+
- const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
|
|
47
|
+
- const errorMessage = getParseErrorMessage(error);
|
|
48
|
+
- throw new McpError(ErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${errorMessage}`);
|
|
49
|
+
+ else {
|
|
50
|
+
+ // if the tool has an output schema, validate structured content
|
|
51
|
+
+ const outputObj = normalizeObjectSchema(tool.outputSchema);
|
|
52
|
+
+ const parseResult = await safeParseAsync(outputObj, result.structuredContent);
|
|
53
|
+
+ if (!parseResult.success) {
|
|
54
|
+
+ const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
|
|
55
|
+
+ const errorMessage = getParseErrorMessage(error);
|
|
56
|
+
+ // Log warning but don't throw - allow schema mismatches
|
|
57
|
+
+ console.warn(`[MCP SDK Patch] Output validation warning: Invalid structured content for tool ${toolName}: ${errorMessage}`);
|
|
58
|
+
+ // Keep the structuredContent despite validation failure
|
|
59
|
+
+ }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|