timetable-api-node 1.7.11 → 1.8.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/INTEGRATION.md CHANGED
@@ -116,6 +116,7 @@ All tools are read-only. Argument names are **exact** — pass them as shown.
116
116
  | `get_route_realtime` | `route_name` (string) | Live vehicles on a route with destination and next stop. |
117
117
  | `get_nearby_vehicles` | `latitude`, `longitude` (numbers), `radius_meters`, `route`, `limit` (optional) | Live vehicles near a coordinate, nearest first. |
118
118
  | `get_vehicle_info` | `vehicle_id` (string) | One vehicle: route, destination, plate, upcoming stops with names. |
119
+ | `get_disruptions` | `route` (string), `stop_id` (optional) | Announced closures, detours and moved stops in force today. Stop, route and trip tools also add a `disruptions` array when one applies — mention it to the user. |
119
120
 
120
121
  Every tool result is JSON with three keys — `view`, `data` (the payload), and `ui_blocks` (ordered map/arrival-list rendering hints that point into `data`). Resolve a stop name with `search_stops`, or an address/coordinates with `get_stops_around_location`, before calling stop-based tools.
121
122
 
package/README.md CHANGED
@@ -196,6 +196,7 @@ All tools are read-only. Stop IDs are the numeric codes on stop signs, returned
196
196
  | `get_route_realtime` | `route_name` | Vehicles on the route with `destination` and `next_stop` (`id`, `name`, ISO `arrival`). |
197
197
  | `get_nearby_vehicles` | `latitude`, `longitude`, `radius_meters` (100–1000, default 500), `route`, `limit` (1–50, default 15) | Live vehicles nearest first, with `destination` and `distance_meters`; `total` counts all in range. |
198
198
  | `get_vehicle_info` | `vehicle_id` | One vehicle: position, route, `destination`, plate, upcoming stops (`id`, `name`, ISO times) not yet passed. |
199
+ | `get_disruptions` | `route`, `stop_id` (both optional) | Announced closures, detours (`detour.via` streets) and moved stops in force today. `get_stop_realtime`, `get_route_static`, `get_route_realtime` and `find_routes_between` also add a `disruptions` array when one touches their routes or stops. |
199
200
 
200
201
  <details>
201
202
  <summary><code>get_stop_realtime</code> — example</summary>
@@ -579,6 +580,14 @@ Vehicles within 1 km of a point. Short-cached (10 s).
579
580
 
580
581
  - **Response:** array of `{ id, route, routeId, direction, vehicle_type, color, location: [lat, lng], bearing, speed, lowfloor }`. `routeId` is usable as `:name` in `/routes/static/:name`; `direction` matches the index into `stops`/`shapes` (0 = outbound, 1 = return, null if unknown). `speed` is m/s or `null`.
581
582
 
583
+ #### `GET /disruptions?route={name}&stop={code}`
584
+
585
+ Closures, detours and moved stops the city announced that are in force today. The GTFS feed carries none of them. Cached 5 min at the CDN.
586
+
587
+ - Hand-curated in [`data/disruptions.json`](data/disruptions.json), checked against a schema at startup and in tests; add or edit an entry there and deploy. An entry is served from its `since` day through its `until` day (Kyiv time), so a stale one hides itself.
588
+ - `route` (Cyrillic or Latin short name) and `stop` (numeric code) are optional filters; with either, only entries touching it are listed.
589
+ - **Response:** `{ disruptions, updated_at }`. Each item: `{ id, kind, reason, since, until, until_text, routes, stops, alternatives, detour, note, source, url }`. `kind` is `suspended`, `detour`, `stop_moved` or `stop_closed`; `routes` and `alternatives` are `{ name, id }` (`name` like `Т33`, `id` the Latin form used in lad.lviv.ua URLs); `detour` is `{ via: [streets], skipped_stops: [codes] }` or `null`.
590
+
582
591
  ### Service and discovery
583
592
 
584
593
  | Endpoint | Returns |
package/index.ts CHANGED
@@ -28,6 +28,7 @@ import vehicleByPlateAction from "./actions/vehicleByPlateAction.ts";
28
28
  import closestTransportAction from "./actions/closestTransportAction.ts";
29
29
  import getAllRoutesAction from "./actions/getAllRoutesAction.ts";
30
30
  import sitemapAction from "./actions/sitemapAction.ts";
31
+ import getDisruptionsAction from "./actions/getDisruptionsAction.ts";
31
32
  import {
32
33
  buildMcpServerCard,
33
34
  handleMcpPostRequest,
@@ -150,6 +151,7 @@ app.get("/routes/static/:name", routeInfoStaticAction);
150
151
  app.get("/vehicle/:vehicleId", vehicleInfoAction);
151
152
  app.get("/vehicle-by-plate/:plate", vehicleByPlateAction);
152
153
  app.get("/transport", liveDataRateLimiter, closestTransportAction);
154
+ app.get("/disruptions", getDisruptionsAction);
153
155
 
154
156
  app.get("/sitemap.xml", sitemapAction);
155
157
 
@@ -272,6 +274,16 @@ app.get("/.well-known/agent.json", (req, res) => {
272
274
  outputModes: ["application/json"],
273
275
  examples: ["Track vehicle 12345", "Where is vehicle 12345 heading?"],
274
276
  },
277
+ {
278
+ id: "get_disruptions",
279
+ name: "Get Disruptions",
280
+ description:
281
+ "Announced closures, detours and moved stops in force today, optionally for one route or stop.",
282
+ tags: ["transit", "disruptions", "detours", "road-works", "lviv"],
283
+ inputModes: ["text/plain"],
284
+ outputModes: ["application/json"],
285
+ examples: ["Is bus А34 on a detour?", "Which routes are affected by road works?"],
286
+ },
275
287
  ],
276
288
  authentication: { schemes: [] },
277
289
  provider: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "timetable-api-node",
3
- "version": "1.7.11",
3
+ "version": "1.8.0",
4
4
  "description": "Lviv (Ukraine) public transport REST API and read-only Model Context Protocol (MCP) server: stops, timetables, routes, live vehicle positions, GTFS/GTFS-RT. No API key required.",
5
5
  "main": "index.ts",
6
6
  "type": "module",