nextbillion-mcp 0.3.0 → 0.3.1
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 +13 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6212,7 +6212,7 @@ var init_text_search = __esm({
|
|
|
6212
6212
|
"places/search/search-places-api/search-places-apis"
|
|
6213
6213
|
],
|
|
6214
6214
|
title: "Search Places",
|
|
6215
|
-
description: 'Search for places, points of interest and businesses with a free-text query (e.g. "gas station", "coffee"), ranked by relevance around a location. Use geocode_forward for plain address-to-coordinates conversion.
|
|
6215
|
+
description: 'Search for places, points of interest and businesses with a free-text query (e.g. "gas station", "coffee"), ranked by relevance around a location. Use geocode_forward for plain address-to-coordinates conversion. Documentation for this API is available through search_documentation. Parameters: query (required); optional near {latitude, longitude} (recommended), radius_m (with near), country_codes, bounding_box {west, south, east, north}, limit, language, view. Example: {"query": "coffee", "near": {"latitude": 37.7749, "longitude": -122.4194}, "radius_m": 1000, "limit": 5}',
|
|
6216
6216
|
path: "/discover",
|
|
6217
6217
|
noun: "place"
|
|
6218
6218
|
});
|
|
@@ -6257,7 +6257,7 @@ var init_geocode_batch = __esm({
|
|
|
6257
6257
|
geocodeBatch = {
|
|
6258
6258
|
name: "geocode_batch",
|
|
6259
6259
|
title: "Batch Geocode",
|
|
6260
|
-
description: 'Forward-geocode up to 100 free-text queries in one request; returns one ranked result set per query, in input order.
|
|
6260
|
+
description: 'Forward-geocode up to 100 free-text queries in one request; returns one ranked result set per query, in input order. Use it instead of repeated geocode_forward calls when several addresses are needed: this endpoint has its own rate limit of 60 requests per minute, so larger batches per call stay within it. Parameters: queries (required array; each item: query (required), optional near {latitude, longitude}, radius_m, country_codes, bounding_box, limit, language, view, types); optional top-level types (houseNumber | addressBlock | street | intersection | place | area) as the default for all queries (a per-query types overrides it). Example: {"queries": [{"query": "600-699 Golden Gate Ave, San Francisco, CA", "types": ["addressBlock"]}, {"query": "Empire State Building", "country_codes": ["USA"]}]}',
|
|
6261
6261
|
inputSchema: Schema,
|
|
6262
6262
|
annotations: READ_ONLY,
|
|
6263
6263
|
docs: ["places/geocoding/batch-geocode/batch-geocode"],
|
|
@@ -6574,7 +6574,7 @@ var init_directions = __esm({
|
|
|
6574
6574
|
directions = {
|
|
6575
6575
|
name: "directions",
|
|
6576
6576
|
title: "Directions",
|
|
6577
|
-
description: 'Calculate a route between an origin and a destination with optional waypoints; returns distance (meters), duration (seconds) and an encoded polyline per route
|
|
6577
|
+
description: 'Calculate a route between an origin and a destination with optional waypoints; returns distance (meters), duration (seconds) and an encoded polyline per route, which static_route_map can draw. Use distance_matrix for many pairs. Documentation for this API is available through search_documentation. Parameters: origin, destination {latitude, longitude} (required); optional waypoints (array, max 200), mode (car | truck | motorcycle | bike | walk), service ("flexible" default: all modes and options; "fast": car/truck only, lower latency), route_type, departure_time (UNIX seconds), avoid (soft filter), exclude (strict filter), road_info (max_speed, toll_*, truck_route, stop_sign, traffic_light), honor_restrictions, alternatives, steps (fast only), geometry (polyline | polyline6), truck options: truck_size_cm {height, width, length}, truck_weight_kg, truck_axle_load (tonnes), hazmat_type, emission_class (euro0-euro9), cross_border. Example: {"origin": {"latitude": 37.7749, "longitude": -122.4194}, "destination": {"latitude": 34.0522, "longitude": -118.2437}, "mode": "truck", "truck_weight_kg": 18000, "hazmat_type": ["flammable_liquid"]}',
|
|
6578
6578
|
inputSchema: Schema7,
|
|
6579
6579
|
annotations: READ_ONLY,
|
|
6580
6580
|
docs: ["routing/directions-api/directions-api"],
|
|
@@ -6664,7 +6664,7 @@ var init_distance_matrix = __esm({
|
|
|
6664
6664
|
distanceMatrix = {
|
|
6665
6665
|
name: "distance_matrix",
|
|
6666
6666
|
title: "Distance Matrix",
|
|
6667
|
-
description: 'Compute travel distance (meters) and duration (seconds) for every origin-to-destination pair in one call; one row per origin with one element per destination, in input order. Use it instead of repeated directions calls when several pairs are needed.
|
|
6667
|
+
description: 'Compute travel distance (meters) and duration (seconds) for every origin-to-destination pair in one call; one row per origin with one element per destination, in input order. Use it instead of repeated directions calls when several pairs are needed. Documentation for this API is available through search_documentation. Parameters: origins, destinations (arrays of {latitude, longitude}, required); optional mode, service ("fast" default: up to 1000x1000 points; "flexible": the options below, max 50x50), route_type, departure_time, avoid (soft), exclude (strict), honor_restrictions, route_failed_prompt (unroutable pairs return -1 instead of 0), truck options: truck_size_cm {height, width, length}, truck_weight_kg, truck_axle_load, hazmat_type, emission_class, cross_border. Example: {"origins": [{"latitude": 1.29, "longitude": 103.85}], "destinations": [{"latitude": 1.35, "longitude": 103.99}, {"latitude": 1.3, "longitude": 103.77}], "route_failed_prompt": true}',
|
|
6668
6668
|
inputSchema: Schema8,
|
|
6669
6669
|
annotations: READ_ONLY,
|
|
6670
6670
|
docs: ["routing/distance-matrix/synchronous", "routing/distance-matrix/asynchronous"],
|
|
@@ -6733,7 +6733,7 @@ var init_isochrone = __esm({
|
|
|
6733
6733
|
isochrone = {
|
|
6734
6734
|
name: "isochrone",
|
|
6735
6735
|
title: "Isochrone",
|
|
6736
|
-
description: 'Calculate the area reachable from a point within given travel times or distances; returns a GeoJSON FeatureCollection of contours (geometry coordinates are [longitude, latitude]).
|
|
6736
|
+
description: 'Calculate the area reachable from a point within given travel times or distances; returns a GeoJSON FeatureCollection of contours (geometry coordinates are [longitude, latitude]). Each contour ring can be drawn with static_route_map by passing it as paths[].geojson_coordinates with a fill_color. Documentation for this API is available through search_documentation. Parameters: origin {latitude, longitude} (required); exactly one of contours_minutes (array, up to 4 values, max 40) or contours_meters (array, up to 4 values, max 60000); optional mode, polygons (true for Polygon geometry), denoise, generalize (meters), contours_colors (hex without #, one per contour), departure_time. Example: {"origin": {"latitude": 37.7749, "longitude": -122.4194}, "contours_minutes": [5, 10], "polygons": true}',
|
|
6737
6737
|
inputSchema: Schema9,
|
|
6738
6738
|
annotations: READ_ONLY,
|
|
6739
6739
|
docs: ["routing/isochrone-api/isochrone-api"],
|
|
@@ -7159,7 +7159,7 @@ var init_static_route_map = __esm({
|
|
|
7159
7159
|
staticRouteMap = {
|
|
7160
7160
|
name: "static_route_map",
|
|
7161
7161
|
title: "Static Route Map",
|
|
7162
|
-
description: 'Render a static map auto-fitted to a route and/or overlays: a route from directions, and/or lines and filled polygons such as isochrone contours; very long geometry is simplified automatically to fit the map API URL limit (distances unaffected). Returns the image inline and, if NBAI_IMAGE_DIR is set, also saves it as a file (path in the result text). Parameters: at least one of encoded_polyline (the geometry string from directions, preferred), route_points (array of {latitude, longitude}) or paths (array of {points OR geojson_coordinates [[longitude, latitude], ...], stroke_color, stroke_width, fill_color}); optional markers (array of {latitude, longitude, color, icon_url, anchor, scale}), stroke_color, stroke_width (route line), padding, width, height, style, format, retina.
|
|
7162
|
+
description: 'Render a static map auto-fitted to a route and/or overlays: a route from directions, and/or lines and filled polygons such as isochrone contours; very long geometry is simplified automatically to fit the map API URL limit (distances unaffected). Returns the image inline and, if NBAI_IMAGE_DIR is set, also saves it as a file (path in the result text). Parameters: at least one of encoded_polyline (the geometry string from directions, preferred), route_points (array of {latitude, longitude}) or paths (array of {points OR geojson_coordinates [[longitude, latitude], ...], stroke_color, stroke_width, fill_color}); optional markers (array of {latitude, longitude, color, icon_url, anchor, scale}), stroke_color, stroke_width (route line), padding, width, height, style, format, retina. The example draws isochrone contours. Example: {"paths": [{"geojson_coordinates": [[-122.42, 37.77], [-122.40, 37.78], [-122.41, 37.79], [-122.42, 37.77]], "fill_color": "rgba(29,78,216,0.35)", "stroke_color": "#1d4ed8"}], "markers": [{"latitude": 37.7749, "longitude": -122.4194, "color": "red"}]}',
|
|
7163
7163
|
inputSchema: Schema12,
|
|
7164
7164
|
annotations: READ_ONLY,
|
|
7165
7165
|
docs: ["maps/static-images-api/static-images-api"],
|
|
@@ -7382,9 +7382,9 @@ var SERVER_INSTRUCTIONS, SEARCH_DOCUMENTATION_DESCRIPTION, GET_DOCUMENTATION_DES
|
|
|
7382
7382
|
var init_descriptions = __esm({
|
|
7383
7383
|
"src/tools/docs/descriptions.ts"() {
|
|
7384
7384
|
"use strict";
|
|
7385
|
-
SERVER_INSTRUCTIONS = "
|
|
7386
|
-
SEARCH_DOCUMENTATION_DESCRIPTION = `Search NextBillion's official API and SDK documentation. Use for any question about how NextBillion works: calling an API, what a parameter means, which API to use, or SDK setup.
|
|
7387
|
-
|
|
7385
|
+
SERVER_INSTRUCTIONS = "This server provides two kinds of tools. The four documentation tools (search_documentation, get_documentation, get_api_parameters, list_documentation_topics) answer questions about how NextBillion.ai APIs and SDKs work from a bundled copy of the official documentation and make no network requests; their results include a source_url for citation. The other tools call the NextBillion.ai API and return live results such as geocodes, places, routes, travel-time matrices, isochrones and map images.";
|
|
7386
|
+
SEARCH_DOCUMENTATION_DESCRIPTION = `Search NextBillion's official API and SDK documentation. Use for any question about how NextBillion works: calling an API, what a parameter means, which API to use, or SDK setup. Answers come from the bundled documentation index, not from live API calls.
|
|
7387
|
+
Queries match best with the docs' own terms and exact parameter names (truck_weight, option=flexible) rather than everyday phrasing; when results are thin, other API terms may match. Results are excerpts: get_documentation returns a full page. Each result carries a source_url for citation and related_tools, the name of the tool that performs the operation.
|
|
7388
7388
|
Parameters:
|
|
7389
7389
|
- query (string, required): search terms.
|
|
7390
7390
|
- category (string, optional): e.g. Routing, Places.
|
|
@@ -7393,13 +7393,9 @@ Parameters:
|
|
|
7393
7393
|
- limit (integer, optional): default 5, max 10.
|
|
7394
7394
|
- include_examples (boolean, optional): default false.
|
|
7395
7395
|
Example: {"query": "truck_size truck_weight routing", "api": "Directions"}`;
|
|
7396
|
-
GET_DOCUMENTATION_DESCRIPTION = 'Fetch the full text of one documentation page by its doc_id, as returned by search_documentation. Use when an excerpt is not enough to answer accurately. Pages over the size limit return truncated: true and a section list;
|
|
7397
|
-
GET_API_PARAMETERS_DESCRIPTION = 'Get structured parameter details for a NextBillion REST API endpoint: type, required, default, allowed values, units and description.
|
|
7398
|
-
LIST_DOCUMENTATION_TOPICS_DESCRIPTION =
|
|
7399
|
-
Parameters:
|
|
7400
|
-
- category (string, optional): limit to one category.
|
|
7401
|
-
- sdk (string, optional): Android, iOS or Flutter.
|
|
7402
|
-
Example: {"category": "Optimization"}`;
|
|
7396
|
+
GET_DOCUMENTATION_DESCRIPTION = 'Fetch the full text of one documentation page by its doc_id, as returned by search_documentation. Use when an excerpt is not enough to answer accurately. Pages over the size limit return truncated: true and a section list; a single section can be requested with section. Sample request and response bodies are omitted unless include_examples is true.\nParameters:\n- doc_id (string, required): page id from search results.\n- section (string, optional): heading of one section to return.\n- include_examples (boolean, optional): default false.\nExample: {"doc_id": "routing/directions-api/examples/legal-routes-for-a-given-truck-weight"}';
|
|
7397
|
+
GET_API_PARAMETERS_DESCRIPTION = 'Get structured parameter details for a NextBillion REST API endpoint: type, required, default, allowed values, units and description. More precise than a prose search for questions about one specific parameter. Returns every matching API variant (e.g. directions/flexible and directions/fast), identified by heading_path. Empty units means the documentation does not state a unit. SDK methods are not covered.\nParameters:\n- endpoint (string, required unless doc_id given): API slug, optionally with variant, e.g. directions or directions/flexible.\n- doc_id (string, optional): page id instead of endpoint.\n- name (string, optional): one parameter name.\nExample: {"endpoint": "directions", "name": "truck_weight"}';
|
|
7398
|
+
LIST_DOCUMENTATION_TOPICS_DESCRIPTION = 'List the available documentation categories, APIs and pages, with index metadata. Useful before searching, when the right terms are not yet known, e.g. to see which APIs exist for a problem area.\nParameters:\n- category (string, optional): limit to one category.\n- sdk (string, optional): Android, iOS or Flutter.\nExample: {"category": "Optimization"}';
|
|
7403
7399
|
DOCS_TOOL_ANNOTATIONS = {
|
|
7404
7400
|
readOnlyHint: true,
|
|
7405
7401
|
destructiveHint: false,
|
|
@@ -22962,7 +22958,7 @@ function extractApiMessage(bodyText) {
|
|
|
22962
22958
|
}
|
|
22963
22959
|
|
|
22964
22960
|
// src/index.ts
|
|
22965
|
-
var pkg = true ? { version: "0.3.
|
|
22961
|
+
var pkg = true ? { version: "0.3.1" } : createRequire(import.meta.url)("../package.json");
|
|
22966
22962
|
function main() {
|
|
22967
22963
|
const args = process.argv.slice(2);
|
|
22968
22964
|
if (args.includes("--version") || args.includes("-v")) {
|
package/package.json
CHANGED