nextbillion-mcp 0.1.9 → 0.1.10
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/dist/index.js +33 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5305,6 +5305,14 @@ function object(shape, params) {
|
|
|
5305
5305
|
};
|
|
5306
5306
|
return new ZodObject(def);
|
|
5307
5307
|
}
|
|
5308
|
+
function strictObject(shape, params) {
|
|
5309
|
+
return new ZodObject({
|
|
5310
|
+
type: "object",
|
|
5311
|
+
shape,
|
|
5312
|
+
catchall: never(),
|
|
5313
|
+
...util_exports.normalizeParams(params)
|
|
5314
|
+
});
|
|
5315
|
+
}
|
|
5308
5316
|
function looseObject(shape, params) {
|
|
5309
5317
|
return new ZodObject({
|
|
5310
5318
|
type: "object",
|
|
@@ -20347,7 +20355,7 @@ ${JSON.stringify(structuredContent)}`;
|
|
|
20347
20355
|
}
|
|
20348
20356
|
|
|
20349
20357
|
// src/tools/shared/geo.ts
|
|
20350
|
-
var CoordinateSchema =
|
|
20358
|
+
var CoordinateSchema = strictObject({
|
|
20351
20359
|
latitude: number2().min(-90).max(90),
|
|
20352
20360
|
longitude: number2().min(-180).max(180)
|
|
20353
20361
|
});
|
|
@@ -20357,7 +20365,7 @@ function toLatLng(coordinate) {
|
|
|
20357
20365
|
function toLatLngList(coordinates) {
|
|
20358
20366
|
return coordinates.map(toLatLng).join("|");
|
|
20359
20367
|
}
|
|
20360
|
-
var BoundingBoxSchema =
|
|
20368
|
+
var BoundingBoxSchema = strictObject({
|
|
20361
20369
|
west: number2().min(-180).max(180).describe("Western longitude"),
|
|
20362
20370
|
south: number2().min(-90).max(90).describe("Southern latitude"),
|
|
20363
20371
|
east: number2().min(-180).max(180).describe("Eastern longitude"),
|
|
@@ -20426,7 +20434,7 @@ ${lines.join("\n")}${more}`;
|
|
|
20426
20434
|
}
|
|
20427
20435
|
|
|
20428
20436
|
// src/tools/places/text-search.ts
|
|
20429
|
-
var TextSearchSchema =
|
|
20437
|
+
var TextSearchSchema = strictObject({
|
|
20430
20438
|
query: string2().min(1).describe("Free-text search query"),
|
|
20431
20439
|
...PlacesFilterShape
|
|
20432
20440
|
});
|
|
@@ -20446,7 +20454,7 @@ function textSearchTool(options) {
|
|
|
20446
20454
|
}
|
|
20447
20455
|
};
|
|
20448
20456
|
}
|
|
20449
|
-
var ForwardGeocodeSchema =
|
|
20457
|
+
var ForwardGeocodeSchema = strictObject({
|
|
20450
20458
|
query: string2().min(1).describe("Free-text search query"),
|
|
20451
20459
|
...PlacesFilterShape,
|
|
20452
20460
|
types: PlaceTypesSchema.optional()
|
|
@@ -20489,18 +20497,21 @@ var autocomplete = textSearchTool({
|
|
|
20489
20497
|
});
|
|
20490
20498
|
|
|
20491
20499
|
// src/tools/places/geocode-batch.ts
|
|
20492
|
-
var BatchQuerySchema =
|
|
20500
|
+
var BatchQuerySchema = strictObject({
|
|
20493
20501
|
query: string2().min(1).describe("Free-text search query for this entry"),
|
|
20494
20502
|
...PlacesFilterShape,
|
|
20495
20503
|
types: PlaceTypesSchema.optional()
|
|
20496
20504
|
});
|
|
20497
|
-
var Schema =
|
|
20498
|
-
queries: array(BatchQuerySchema).min(1).max(100).describe("Up to 100 forward-geocode queries resolved in a single request")
|
|
20505
|
+
var Schema = strictObject({
|
|
20506
|
+
queries: array(BatchQuerySchema).min(1).max(100).describe("Up to 100 forward-geocode queries resolved in a single request"),
|
|
20507
|
+
types: PlaceTypesSchema.optional().describe(
|
|
20508
|
+
"Default result-type filter applied to every query that does not set its own `types` (houseNumber, addressBlock, street, intersection, place, area)"
|
|
20509
|
+
)
|
|
20499
20510
|
});
|
|
20500
20511
|
var geocodeBatch = {
|
|
20501
20512
|
name: "geocode_batch",
|
|
20502
20513
|
title: "Batch Geocode",
|
|
20503
|
-
description:
|
|
20514
|
+
description: 'Forward-geocode up to 100 free-text queries in one request; returns one ranked result set per query, in input order. Strongly prefer this over repeated geocode_forward calls when resolving several addresses \u2014 this endpoint has a dedicated (low) rate limit of 60 requests per minute, so batch as much as possible into each call. Each query object accepts the same filters as geocode_forward \u2014 near, radius_m, country_codes, bounding_box, limit, language, view, and types \u2014 for example: {"queries": [{"query": "600-699 Golden Gate Ave, San Francisco, CA", "types": ["addressBlock"]}]}. A top-level `types` sets the default for all queries.',
|
|
20504
20515
|
inputSchema: Schema,
|
|
20505
20516
|
annotations: READ_ONLY,
|
|
20506
20517
|
async run(args, nb) {
|
|
@@ -20512,7 +20523,7 @@ var geocodeBatch = {
|
|
|
20512
20523
|
in: filters.in,
|
|
20513
20524
|
limit: filters.limit,
|
|
20514
20525
|
lang: filters.lang,
|
|
20515
|
-
types: entry.types?.join(",")
|
|
20526
|
+
types: (entry.types ?? args.types)?.join(",")
|
|
20516
20527
|
};
|
|
20517
20528
|
});
|
|
20518
20529
|
const response = await nb.postJson("/geocode/batch", {}, body);
|
|
@@ -20533,7 +20544,7 @@ ${lines.join("\n")}`, {
|
|
|
20533
20544
|
};
|
|
20534
20545
|
|
|
20535
20546
|
// src/tools/places/geocode-reverse.ts
|
|
20536
|
-
var Schema2 =
|
|
20547
|
+
var Schema2 = strictObject({
|
|
20537
20548
|
coordinate: CoordinateSchema.describe("The location to reverse geocode"),
|
|
20538
20549
|
country_codes: CountryCodesSchema.optional(),
|
|
20539
20550
|
bounding_box: BoundingBoxSchema.optional().describe("Hard-limit results to this bounding box"),
|
|
@@ -20559,7 +20570,7 @@ var geocodeReverse = {
|
|
|
20559
20570
|
};
|
|
20560
20571
|
|
|
20561
20572
|
// src/tools/places/geocode-structured.ts
|
|
20562
|
-
var Schema3 =
|
|
20573
|
+
var Schema3 = strictObject({
|
|
20563
20574
|
country_code: string2().regex(/^[A-Za-z]{3}$/, "ISO 3166-1 alpha-3 code, e.g. USA").describe('Country of the address (required, ISO 3166-1 alpha-3, e.g. "USA")'),
|
|
20564
20575
|
state: string2().optional(),
|
|
20565
20576
|
county: string2().optional(),
|
|
@@ -20607,7 +20618,7 @@ var geocodeStructured = {
|
|
|
20607
20618
|
};
|
|
20608
20619
|
|
|
20609
20620
|
// src/tools/places/place-lookup.ts
|
|
20610
|
-
var Schema4 =
|
|
20621
|
+
var Schema4 = strictObject({
|
|
20611
20622
|
id: string2().min(1).describe("Unique place id, as returned by the other place/geocoding tools"),
|
|
20612
20623
|
view: ViewSchema.optional()
|
|
20613
20624
|
});
|
|
@@ -20627,7 +20638,7 @@ var placeLookup = {
|
|
|
20627
20638
|
};
|
|
20628
20639
|
|
|
20629
20640
|
// src/tools/places/postcode-lookup.ts
|
|
20630
|
-
var Schema5 =
|
|
20641
|
+
var Schema5 = strictObject({
|
|
20631
20642
|
postal_code: string2().optional().describe("Postal/ZIP code to look up (requires `country`; do not combine with `coordinate`)"),
|
|
20632
20643
|
country: string2().optional().describe(
|
|
20633
20644
|
"Country of the postal code \u2014 name, alpha-2, or alpha-3 ISO code. Required with `postal_code`"
|
|
@@ -20687,7 +20698,7 @@ var AVOID_VALUES = [
|
|
|
20687
20698
|
"tunnel",
|
|
20688
20699
|
"none"
|
|
20689
20700
|
];
|
|
20690
|
-
var Schema6 =
|
|
20701
|
+
var Schema6 = strictObject({
|
|
20691
20702
|
origin: CoordinateSchema.describe("Route start (must be a routable land location)"),
|
|
20692
20703
|
destination: CoordinateSchema.describe("Route end (must be a routable land location)"),
|
|
20693
20704
|
waypoints: array(CoordinateSchema).max(200).optional().describe("Intermediate stops visited in order (max 200)"),
|
|
@@ -20710,7 +20721,7 @@ var Schema6 = object({
|
|
|
20710
20721
|
geometry: _enum(["polyline", "polyline6"]).optional().describe(
|
|
20711
20722
|
"Route geometry encoding (default polyline, precision 5 \u2014 directly usable with static_route_map)"
|
|
20712
20723
|
),
|
|
20713
|
-
truck_size_cm:
|
|
20724
|
+
truck_size_cm: strictObject({ height: number2(), width: number2(), length: number2() }).optional().describe("Truck dimensions in cm (flexible + mode=truck only)"),
|
|
20714
20725
|
truck_weight_kg: number2().int().max(1e5).optional().describe("Truck gross weight in kg (flexible + mode=truck only)")
|
|
20715
20726
|
});
|
|
20716
20727
|
var directions = {
|
|
@@ -20759,7 +20770,7 @@ Geometry (encoded polyline) is in structured content.` : "No route found.",
|
|
|
20759
20770
|
};
|
|
20760
20771
|
|
|
20761
20772
|
// src/tools/routing/distance-matrix.ts
|
|
20762
|
-
var Schema7 =
|
|
20773
|
+
var Schema7 = strictObject({
|
|
20763
20774
|
origins: array(CoordinateSchema).min(1).max(1e3).describe("Start points (matrix rows)"),
|
|
20764
20775
|
destinations: array(CoordinateSchema).min(1).max(1e3).describe("End points (matrix columns)"),
|
|
20765
20776
|
mode: _enum(["car", "truck", "motorcycle", "bike", "walk"]).optional().describe("Travel mode (default car). Modes other than car/truck require service=flexible"),
|
|
@@ -20774,7 +20785,7 @@ var Schema7 = object({
|
|
|
20774
20785
|
honor_restrictions: boolean2().optional().describe(
|
|
20775
20786
|
"When true, enforce restricted-area rules for origin/destination points instead of routing through with a warning (flexible service only)"
|
|
20776
20787
|
),
|
|
20777
|
-
truck_size_cm:
|
|
20788
|
+
truck_size_cm: strictObject({ height: number2(), width: number2(), length: number2() }).optional().describe("Truck dimensions in cm (flexible + mode=truck only)"),
|
|
20778
20789
|
truck_weight_kg: number2().int().max(1e5).optional().describe("Truck gross weight in kg (flexible + mode=truck only)")
|
|
20779
20790
|
});
|
|
20780
20791
|
var distanceMatrix = {
|
|
@@ -20817,7 +20828,7 @@ var distanceMatrix = {
|
|
|
20817
20828
|
};
|
|
20818
20829
|
|
|
20819
20830
|
// src/tools/routing/isochrone.ts
|
|
20820
|
-
var Schema8 =
|
|
20831
|
+
var Schema8 = strictObject({
|
|
20821
20832
|
origin: CoordinateSchema.describe("Starting point of the reachability analysis"),
|
|
20822
20833
|
contours_minutes: array(number2().int().min(1).max(40)).max(4).optional().describe("Travel times in minutes, one contour each (max 4 values, increasing, max 40)"),
|
|
20823
20834
|
contours_meters: array(number2().int().min(1).max(6e4)).max(4).optional().describe("Travel distances in meters, one contour each (max 4 values, increasing, max 60000)"),
|
|
@@ -20861,7 +20872,7 @@ var isochrone = {
|
|
|
20861
20872
|
};
|
|
20862
20873
|
|
|
20863
20874
|
// src/tools/routing/search-along-route.ts
|
|
20864
|
-
var Schema9 =
|
|
20875
|
+
var Schema9 = strictObject({
|
|
20865
20876
|
route_points: array(CoordinateSchema).min(2).describe("Waypoints defining the route to search along, in travel order"),
|
|
20866
20877
|
query: string2().min(1).describe('What to find along the route, e.g. "gas station", "coffee"'),
|
|
20867
20878
|
max_detour_seconds: number2().int().min(1).max(3600).optional().describe("Max driving time to reach a result after leaving the route (default 900 = 15 min)"),
|
|
@@ -20969,7 +20980,7 @@ async function saveImage(data, prefix, ext) {
|
|
|
20969
20980
|
}
|
|
20970
20981
|
|
|
20971
20982
|
// src/tools/maps/static-map-image.ts
|
|
20972
|
-
var Schema10 =
|
|
20983
|
+
var Schema10 = strictObject({
|
|
20973
20984
|
center: CoordinateSchema.describe("Center of the map view"),
|
|
20974
20985
|
zoom: number2().min(0).max(22).describe("Zoom level (0 = world, ~10 = city, ~15 = streets; fractional values allowed)"),
|
|
20975
20986
|
markers: array(CoordinateSchema.extend({ color: string2().optional() })).optional().describe('Markers to draw, each with optional color (e.g. "red", "#0000ff")'),
|
|
@@ -21099,7 +21110,7 @@ function fitPolylineToBudget(points, maxEncodedChars) {
|
|
|
21099
21110
|
}
|
|
21100
21111
|
|
|
21101
21112
|
// src/tools/maps/static-route-map.ts
|
|
21102
|
-
var Schema11 =
|
|
21113
|
+
var Schema11 = strictObject({
|
|
21103
21114
|
encoded_polyline: string2().optional().describe(
|
|
21104
21115
|
"Route geometry as a Google encoded polyline (precision 5) \u2014 exactly what the directions tool returns with its default geometry setting"
|
|
21105
21116
|
),
|
|
@@ -21343,7 +21354,7 @@ function extractApiMessage(bodyText) {
|
|
|
21343
21354
|
}
|
|
21344
21355
|
|
|
21345
21356
|
// src/index.ts
|
|
21346
|
-
var pkg = true ? { version: "0.1.
|
|
21357
|
+
var pkg = true ? { version: "0.1.10" } : createRequire(import.meta.url)("../package.json");
|
|
21347
21358
|
function main() {
|
|
21348
21359
|
const args = process.argv.slice(2);
|
|
21349
21360
|
if (args.includes("--version") || args.includes("-v")) {
|
package/package.json
CHANGED