@cyanheads/wsdot-mcp-server 0.3.0 → 0.4.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/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +15 -11
- package/changelog/0.4.x/0.4.0.md +26 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-routes.tool.d.ts +9 -2
- package/dist/mcp-server/tools/definitions/get-ferry-routes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-routes.tool.js +40 -5
- package/dist/mcp-server/tools/definitions/get-ferry-routes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-schedule.tool.d.ts +10 -3
- package/dist/mcp-server/tools/definitions/get-ferry-schedule.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-schedule.tool.js +89 -19
- package/dist/mcp-server/tools/definitions/get-ferry-schedule.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-terminals.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/get-ferry-terminals.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-terminals.tool.js +12 -5
- package/dist/mcp-server/tools/definitions/get-ferry-terminals.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-mountain-passes.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/get-mountain-passes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-mountain-passes.tool.js +9 -4
- package/dist/mcp-server/tools/definitions/get-mountain-passes.tool.js.map +1 -1
- package/dist/services/ferry/ferry-service.d.ts +20 -0
- package/dist/services/ferry/ferry-service.d.ts.map +1 -1
- package/dist/services/ferry/ferry-service.js +186 -49
- package/dist/services/ferry/ferry-service.js.map +1 -1
- package/dist/services/ferry/types.d.ts +52 -4
- package/dist/services/ferry/types.d.ts.map +1 -1
- package/dist/services/text-field.d.ts +31 -0
- package/dist/services/text-field.d.ts.map +1 -0
- package/dist/services/text-field.js +41 -0
- package/dist/services/text-field.js.map +1 -0
- package/dist/services/traffic/traffic-service.d.ts.map +1 -1
- package/dist/services/traffic/traffic-service.js +66 -86
- package/dist/services/traffic/traffic-service.js.map +1 -1
- package/dist/services/traffic/types.d.ts +3 -3
- package/dist/services/traffic/types.d.ts.map +1 -1
- package/dist/services/wcf-date.d.ts +6 -4
- package/dist/services/wcf-date.d.ts.map +1 -1
- package/dist/services/wcf-date.js +8 -4
- package/dist/services/wcf-date.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** @cyanheads/wsdot-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
4
|
+
**Version:** 0.4.0
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** @cyanheads/wsdot-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
4
|
+
**Version:** 0.4.0
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/wsdot-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/wsdot-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -37,9 +37,9 @@ Washington State transportation data from the WSDOT Traveler API and the WSF Fer
|
|
|
37
37
|
| `wsdot_get_toll_rates` | Dynamic toll rates for WA express lanes and tolled facilities — SR 99, SR 167 HOT, I-405 Express, SR 509, SR 520 — filterable by route. |
|
|
38
38
|
| `wsdot_get_border_waits` | Current vehicle wait times at all WA/Canada land border crossings. |
|
|
39
39
|
| `wsdot_search_cameras` | Highway camera metadata and image URLs, filterable by state route, region, milepost range, and title words. |
|
|
40
|
-
| `wsdot_get_ferry_terminals` | All WSF ferry terminals with numeric IDs needed for schedule and space lookups. |
|
|
41
|
-
| `wsdot_get_ferry_routes` | WSF routes operating on a given date — route ID, abbreviation, and
|
|
42
|
-
| `wsdot_get_ferry_schedule` | Departure times for a specific WSF route — today-remaining or full-day future mode. |
|
|
40
|
+
| `wsdot_get_ferry_terminals` | All WSF ferry terminals with numeric IDs needed for schedule and space lookups, plus coordinates. |
|
|
41
|
+
| `wsdot_get_ferry_routes` | WSF routes operating on a given date — route ID, abbreviation, description, and the terminal pairs each serves, for route discovery, schedule lookups, and ferry-alert cross-reference. |
|
|
42
|
+
| `wsdot_get_ferry_schedule` | Departure times for a specific WSF route — today-remaining or full-day future mode — with each sailing's vessel, loading rule, and notes. |
|
|
43
43
|
| `wsdot_get_vessel_locations` | Real-time AIS positions, speed, heading, ETA, and dock status for all active WSF vessels. |
|
|
44
44
|
| `wsdot_get_terminal_space` | Drive-up and reservable vehicle space available at WSF terminals for upcoming sailings. |
|
|
45
45
|
| `wsdot_get_ferry_alerts` | Active WSF service disruptions and bulletins with impacted route IDs. |
|
|
@@ -112,27 +112,31 @@ Washington State transportation data from the WSDOT Traveler API and the WSF Fer
|
|
|
112
112
|
|
|
113
113
|
- No input parameters — returns all 20 WSF ferry terminals; the list rarely changes
|
|
114
114
|
- Call this first to resolve human-readable names (e.g. "Bainbridge Island", "Seattle", "Kingston") to the numeric IDs required by `wsdot_get_ferry_schedule` and `wsdot_get_terminal_space`
|
|
115
|
-
- Each terminal also carries
|
|
115
|
+
- Each terminal also carries its abbreviation and latitude/longitude
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
119
119
|
### `wsdot_get_ferry_routes` <sub>tool</sub>
|
|
120
120
|
|
|
121
121
|
- Optional `tripDate` (ISO 8601 `YYYY-MM-DD`); defaults to today
|
|
122
|
-
- Returns each route's ID, abbreviation, and description
|
|
122
|
+
- Returns each route's ID, abbreviation, and description, plus `terminalPairs`: the directed departing → arriving terminal pairs (IDs and names) the route serves that day. These are exactly the pairs `wsdot_get_ferry_schedule` accepts for that date; a route serving none carries an empty list
|
|
123
123
|
- Route IDs correspond to `impactedRouteIds` in `wsdot_get_ferry_alerts` — use this tool to resolve alert route IDs to route names
|
|
124
|
-
-
|
|
124
|
+
- A date outside the range WSF has published (before today, or past the posted schedule) returns a typed `invalid_date` error stating WSF's range. A date inside that range with no sailings loaded yet returns an empty list and a notice
|
|
125
|
+
- The pairs cost one lookup per route, cached per date until WSF signals a schedule change; if any lookup fails, the whole call fails
|
|
125
126
|
|
|
126
127
|
---
|
|
127
128
|
|
|
128
129
|
### `wsdot_get_ferry_schedule` <sub>tool</sub>
|
|
129
130
|
|
|
130
|
-
- Requires `departingTerminalId` and `arrivingTerminalId`, both positive integers — use `wsdot_get_ferry_terminals` first
|
|
131
|
-
- Optional `tripDate` (defaults to today) and `remainingOnly: true` (only future departures for today; ignored for
|
|
131
|
+
- Requires `departingTerminalId` and `arrivingTerminalId`, both positive integers — use `wsdot_get_ferry_terminals` first, or pick a pair from `terminalPairs` on `wsdot_get_ferry_routes`
|
|
132
|
+
- Optional `tripDate` (defaults to today) and `remainingOnly: true` (only future departures for today; ignored for any other date, and the response then reports `remainingOnly: false`)
|
|
133
|
+
- Each sailing carries `vesselId` (the ID `wsdot_get_vessel_locations` reports), `loadingRule`, `vesselHandicapAccessible`, and `annotationIndexes` into the pair's `annotations`, notes such as "No interisland vehicles. Foot passenger and bikes okay." The rendered text lists each sailing's notes under it. WSF does not document `loadingRule`: 3 appears on nearly every sailing and 1 only on vehicle-restricted ones, so read the notes for the restriction itself
|
|
134
|
+
- `annotations` and the pair-wide `sailingNotes` arrive from WSF as HTML and are returned as plain text, with links kept as `link text (url)`
|
|
132
135
|
- `departureTime` and `arrivalTime` are ISO 8601 **UTC**, while `tripDate` is the Pacific service day — an evening sailing therefore carries the following UTC calendar date and will not match `tripDate`. Convert to `America/Los_Angeles` before quoting a clock time
|
|
133
136
|
- `arrivalTime` is populated on some routes and absent on others
|
|
134
137
|
- No cancellation status — WSF drops a cancelled sailing from the schedule rather than flagging it, so a listed sailing is not confirmation it will run; check `wsdot_get_ferry_alerts`, which reports disruptions at route level
|
|
135
|
-
- An invalid or non-through terminal pair returns a typed `invalid_terminal_pair` error rather than an empty schedule
|
|
138
|
+
- An invalid or non-through terminal pair returns a typed `invalid_terminal_pair` error rather than an empty schedule; its recovery hint points at `terminalPairs` on `wsdot_get_ferry_routes` for the same date
|
|
139
|
+
- A date WSF has no schedule for returns `invalid_date` instead — whether it falls outside WSF's published range or inside it with no routes loaded
|
|
136
140
|
|
|
137
141
|
---
|
|
138
142
|
|
|
@@ -179,7 +183,7 @@ Agent-friendly output:
|
|
|
179
183
|
- Typed failure — `invalid_access_code` and `api_unavailable` errors carry an explicit recovery hint distinguishing configuration faults from transient upstream ones
|
|
180
184
|
- `driveUpSpaceCount: 0` and congestion delta fields (`delayInMinutes`) give agents actionable signal without string parsing
|
|
181
185
|
- Partial data preserved — sparse upstream payloads surface `null`/`undefined` rather than synthetic defaults (e.g. an omitted `waitTimeInMinutes`, an absent `arrivalTime`)
|
|
182
|
-
- `content[]` and `structuredContent` carry the same values, not just the same fields — a `false` flag, an empty list, and one populated half of a coordinate pair all render rather than dropping out of the markdown surface that some clients read
|
|
186
|
+
- `content[]` and `structuredContent` carry the same values, not just the same fields — a `false` flag, an empty list, and one populated half of a coordinate pair all render rather than dropping out of the markdown surface that some clients read; a blank or whitespace-only upstream string is absent from both, and a populated one arrives trimmed
|
|
183
187
|
|
|
184
188
|
## Getting started
|
|
185
189
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Ferry routes list the terminal pairs each one serves and schedules carry per-sailing vessel and annotation detail; dates WSF has no schedule for fail as invalid_date, and blank upstream strings are absent instead of empty."
|
|
3
|
+
breaking: true
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.4.0 — 2026-09-24
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`wsdot_get_ferry_routes` `terminalPairs`** ([#41](https://github.com/cyanheads/wsdot-mcp-server/issues/41)) — each route lists the directed departing → arriving terminal IDs and names it serves on the date, the exact pairs `wsdot_get_ferry_schedule` accepts; `[]` when it serves none. Pairs are cached per date until WSF's `cacheflushdate` changes, and a failed pair lookup fails the call.
|
|
12
|
+
- **`wsdot_get_ferry_schedule` sailing detail** ([#50](https://github.com/cyanheads/wsdot-mcp-server/issues/50)) — each sailing gains `vesselId`, `loadingRule`, `vesselHandicapAccessible`, and `annotationIndexes` into a new pair-level `annotations` list, plus a pair-wide `sailingNotes`. Both note fields are HTML upstream and returned as plain text with link URLs kept.
|
|
13
|
+
|
|
14
|
+
## Changed
|
|
15
|
+
|
|
16
|
+
- **Ferry dates without a published schedule fail as `invalid_date`** ([#40](https://github.com/cyanheads/wsdot-mcp-server/issues/40)) — on `wsdot_get_ferry_routes` and `wsdot_get_ferry_schedule`, a date outside WSF's window is non-retryable `invalid_date` with WSF's accepted range in the message, not `api_unavailable` or `invalid_terminal_pair`. The schedule tool also returns `invalid_date` for an in-window date with no routes loaded; the routes tool returns `[]` with a notice that no longer advises retrying.
|
|
17
|
+
- **`invalid_terminal_pair` recovery hint** points at `terminalPairs` on `wsdot_get_ferry_routes` for the same date.
|
|
18
|
+
- **Identity fields are optional** ([#46](https://github.com/cyanheads/wsdot-mcp-server/issues/46)) — `mountainPassId` and `mountainPassName` on `wsdot_get_mountain_passes`, and `terminalId` and `terminalName` on `wsdot_get_ferry_terminals`, are absent when upstream omits them instead of `0` / `'Unknown'`.
|
|
19
|
+
- **Migration:** read the four identity fields above as optional, and expect `invalid_date` where an out-of-window ferry date previously returned `api_unavailable` or `invalid_terminal_pair`.
|
|
20
|
+
- **Internal:** `docs/design.md` gives the ferry `TripDate` path format as `YYYY-MM-DD` and records decisions 13 (pair cache) and 14 (date rejection over a `validdaterange` pre-check); service tests reject any unmocked `fetch`.
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
- **Blank upstream strings** ([#46](https://github.com/cyanheads/wsdot-mcp-server/issues/46)) — an empty, whitespace-only, or markup-only upstream string is absent from both `structuredContent` and `content[]` on every tool, and a populated one is trimmed; a blank WCF date yields no date field. A pass's blank `weatherCondition` was the visible case.
|
|
25
|
+
- **`wsdot_get_ferry_terminals` coordinates** ([#42](https://github.com/cyanheads/wsdot-mcp-server/issues/42)) — the service reads `Terminals/rest/terminallocations`, so `latitude` and `longitude` populate on all 20 terminals.
|
|
26
|
+
- **`wsdot_get_ferry_schedule` `remainingOnly`** — reports the effective value, `false` for any date other than today.
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ await createApp({
|
|
|
36
36
|
],
|
|
37
37
|
resources: [],
|
|
38
38
|
prompts: [],
|
|
39
|
-
instructions: 'WSDOT Traveler Information server for Washington State. Traffic tools (mountain passes, alerts, travel times, toll rates, border waits, cameras) use the WSDOT Traffic API. Ferry tools use the WSF Ferry API. For ferry schedule and space lookups, first call wsdot_get_ferry_terminals to resolve terminal names to numeric IDs. Ferry route IDs from wsdot_get_ferry_routes correspond to impactedRouteIds in wsdot_get_ferry_alerts.',
|
|
39
|
+
instructions: 'WSDOT Traveler Information server for Washington State. Traffic tools (mountain passes, alerts, travel times, toll rates, border waits, cameras) use the WSDOT Traffic API. Ferry tools use the WSF Ferry API. For ferry schedule and space lookups, first call wsdot_get_ferry_terminals to resolve terminal names to numeric IDs; wsdot_get_ferry_routes lists the terminal pairs each route serves on a date, which are the pairs wsdot_get_ferry_schedule accepts. Ferry route IDs from wsdot_get_ferry_routes correspond to impactedRouteIds in wsdot_get_ferry_alerts.',
|
|
40
40
|
landing: { requireAuth: false },
|
|
41
41
|
setup(core) {
|
|
42
42
|
initTrafficApiService(core.config, core.storage);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,kBAAkB;IACzB,4FAA4F;IAC5F,yFAAyF;IACzF,sCAAsC;IACtC,WAAW,EAAE,WAAW;IACxB,qFAAqF;IACrF,kFAAkF;IAClF,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE;QACzD,iBAAiB,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE;KAC/D;IACD,KAAK,EAAE;QACL,iBAAiB;QACjB,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,cAAc;QACd,aAAa;QACb,iBAAiB;QACjB,cAAc;QACd,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,cAAc;KACf;IACD,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,kBAAkB;IACzB,4FAA4F;IAC5F,yFAAyF;IACzF,sCAAsC;IACtC,WAAW,EAAE,WAAW;IACxB,qFAAqF;IACrF,kFAAkF;IAClF,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE;QACzD,iBAAiB,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE;KAC/D;IACD,KAAK,EAAE;QACL,iBAAiB;QACjB,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,cAAc;QACd,aAAa;QACb,iBAAiB;QACjB,cAAc;QACd,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,cAAc;KACf;IACD,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,8iBAA8iB;IAChjB,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B,KAAK,CAAC,IAAI;QACR,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -11,6 +11,12 @@ export declare const getFerryRoutes: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
11
11
|
routeId: z.ZodOptional<z.ZodNumber>;
|
|
12
12
|
routeAbbrev: z.ZodOptional<z.ZodString>;
|
|
13
13
|
description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
terminalPairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
+
departingTerminalId: z.ZodNumber;
|
|
16
|
+
departingTerminalName: z.ZodOptional<z.ZodString>;
|
|
17
|
+
arrivingTerminalId: z.ZodNumber;
|
|
18
|
+
arrivingTerminalName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>>>;
|
|
14
20
|
}, z.core.$strip>>;
|
|
15
21
|
}, z.core.$strip>, readonly [{
|
|
16
22
|
readonly reason: "api_unavailable";
|
|
@@ -29,8 +35,9 @@ export declare const getFerryRoutes: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
29
35
|
}, {
|
|
30
36
|
readonly reason: "invalid_date";
|
|
31
37
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
32
|
-
readonly when: "The
|
|
33
|
-
readonly
|
|
38
|
+
readonly when: "The tripDate is not a valid YYYY-MM-DD date, or WSF rejects it as outside the dates it has published a schedule for.";
|
|
39
|
+
readonly retryable: false;
|
|
40
|
+
readonly recovery: "Use a YYYY-MM-DD date from today (Pacific time) through the end of the posted schedule; when WSF rejects the date, the message states the range it accepts.";
|
|
34
41
|
}], {
|
|
35
42
|
readonly tripDate: z.ZodString;
|
|
36
43
|
readonly totalCount: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ferry-routes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-routes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"get-ferry-routes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-routes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyKzB,CAAC"}
|
|
@@ -7,10 +7,12 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
7
|
import { FerryApiService, getFerryApiService } from '../../../services/ferry/ferry-service.js';
|
|
8
8
|
export const getFerryRoutes = tool('wsdot_get_ferry_routes', {
|
|
9
9
|
title: 'Get Ferry Routes',
|
|
10
|
-
description: 'Returns the main WSF ferry routes operating on a given date
|
|
10
|
+
description: 'Returns the main WSF ferry routes operating on a given date, each with the directed terminal ' +
|
|
11
|
+
'pairs it serves that day (terminalPairs) — departing and arriving terminal IDs and names, which ' +
|
|
12
|
+
'are exactly the pairs wsdot_get_ferry_schedule accepts for that date. ' +
|
|
11
13
|
'Route IDs correspond to impactedRouteIds in ferry alerts from wsdot_get_ferry_alerts, though some ' +
|
|
12
14
|
'alert route IDs (seasonal, San Juan interisland, or Sidney B.C.) may not appear in this list. ' +
|
|
13
|
-
'
|
|
15
|
+
'For the full terminal list with coordinates, use wsdot_get_ferry_terminals.',
|
|
14
16
|
annotations: { readOnlyHint: true },
|
|
15
17
|
input: z.object({
|
|
16
18
|
tripDate: z
|
|
@@ -35,6 +37,28 @@ export const getFerryRoutes = tool('wsdot_get_ferry_routes', {
|
|
|
35
37
|
.string()
|
|
36
38
|
.optional()
|
|
37
39
|
.describe('Full route description (e.g. "Seattle/Bainbridge Island").'),
|
|
40
|
+
terminalPairs: z
|
|
41
|
+
.array(z
|
|
42
|
+
.object({
|
|
43
|
+
departingTerminalId: z
|
|
44
|
+
.number()
|
|
45
|
+
.describe('Departing terminal ID — the departingTerminalId to pass to wsdot_get_ferry_schedule.'),
|
|
46
|
+
departingTerminalName: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Departing terminal name. Absent when upstream omits it.'),
|
|
50
|
+
arrivingTerminalId: z
|
|
51
|
+
.number()
|
|
52
|
+
.describe('Arriving terminal ID — the arrivingTerminalId to pass to wsdot_get_ferry_schedule.'),
|
|
53
|
+
arrivingTerminalName: z
|
|
54
|
+
.string()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Arriving terminal name. Absent when upstream omits it.'),
|
|
57
|
+
})
|
|
58
|
+
.describe('One direction of service between two terminals on the requested date.'))
|
|
59
|
+
.optional()
|
|
60
|
+
.describe('Directed terminal pairs this route serves on the requested date; empty when it serves none. ' +
|
|
61
|
+
'Absent only when upstream omits the route ID the lookup needs.'),
|
|
38
62
|
})
|
|
39
63
|
.describe('A WSF ferry route operating on the requested date.'))
|
|
40
64
|
.describe('Ferry routes operating on the requested date.'),
|
|
@@ -67,8 +91,9 @@ export const getFerryRoutes = tool('wsdot_get_ferry_routes', {
|
|
|
67
91
|
{
|
|
68
92
|
reason: 'invalid_date',
|
|
69
93
|
code: JsonRpcErrorCode.ValidationError,
|
|
70
|
-
when: 'The
|
|
71
|
-
|
|
94
|
+
when: 'The tripDate is not a valid YYYY-MM-DD date, or WSF rejects it as outside the dates it has published a schedule for.',
|
|
95
|
+
retryable: false,
|
|
96
|
+
recovery: 'Use a YYYY-MM-DD date from today (Pacific time) through the end of the posted schedule; when WSF rejects the date, the message states the range it accepts.',
|
|
72
97
|
},
|
|
73
98
|
],
|
|
74
99
|
async handler(input, ctx) {
|
|
@@ -85,7 +110,7 @@ export const getFerryRoutes = tool('wsdot_get_ferry_routes', {
|
|
|
85
110
|
ctx.log.info('Ferry routes fetched', { tripDate, count: routes.length });
|
|
86
111
|
ctx.enrich({ tripDate, totalCount: routes.length });
|
|
87
112
|
if (routes.length === 0) {
|
|
88
|
-
ctx.enrich.notice(`
|
|
113
|
+
ctx.enrich.notice(`WSF lists no routes for ${tripDate}. The date is inside the window WSF accepts, but no sailings are loaded for it yet — typically a season whose schedule has not been posted. Try an earlier date.`);
|
|
89
114
|
}
|
|
90
115
|
return { routes };
|
|
91
116
|
},
|
|
@@ -93,6 +118,7 @@ export const getFerryRoutes = tool('wsdot_get_ferry_routes', {
|
|
|
93
118
|
if (result.routes.length === 0) {
|
|
94
119
|
return [{ type: 'text', text: 'No ferry routes found for this date.' }];
|
|
95
120
|
}
|
|
121
|
+
const terminal = (id, name) => name ? `${name} (${id})` : `terminal ${id}`;
|
|
96
122
|
const lines = [];
|
|
97
123
|
for (const r of result.routes) {
|
|
98
124
|
const name = r.description ?? r.routeAbbrev ?? 'Unknown route';
|
|
@@ -101,6 +127,15 @@ export const getFerryRoutes = tool('wsdot_get_ferry_routes', {
|
|
|
101
127
|
lines.push(`**Abbrev:** ${r.routeAbbrev}`);
|
|
102
128
|
if (r.routeId != null)
|
|
103
129
|
lines.push(`**Route ID:** ${r.routeId}`);
|
|
130
|
+
if (r.terminalPairs?.length === 0) {
|
|
131
|
+
lines.push('**Terminal pairs:** none served on this date');
|
|
132
|
+
}
|
|
133
|
+
else if (r.terminalPairs) {
|
|
134
|
+
lines.push('**Terminal pairs** (departing → arriving):');
|
|
135
|
+
for (const p of r.terminalPairs) {
|
|
136
|
+
lines.push(`- ${terminal(p.departingTerminalId, p.departingTerminalName)} → ${terminal(p.arrivingTerminalId, p.arrivingTerminalName)}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
104
139
|
lines.push('');
|
|
105
140
|
}
|
|
106
141
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ferry-routes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-routes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAExF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,wBAAwB,EAAE;IAC3D,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,+
|
|
1
|
+
{"version":3,"file":"get-ferry-routes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-routes.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAExF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,wBAAwB,EAAE;IAC3D,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,+FAA+F;QAC/F,kGAAkG;QAClG,wEAAwE;QACxE,oGAAoG;QACpG,gGAAgG;QAChG,6EAA6E;IAC/E,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC;aACR,MAAM,EAA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B,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAChE,IAAI,CAAC,CAAC,aAAa,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;gBAClC,KAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YAC7D,CAAC;iBAAM,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;gBAC3B,KAAK,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;gBACzD,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;oBAChC,KAAK,CAAC,IAAI,CACR,KAAK,QAAQ,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,qBAAqB,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,oBAAoB,CAAC,EAAE,CAC5H,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -12,10 +12,16 @@ export declare const getFerrySchedule: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
12
12
|
}, z.core.$strip>, z.ZodObject<{
|
|
13
13
|
departingTerminalName: z.ZodOptional<z.ZodString>;
|
|
14
14
|
arrivingTerminalName: z.ZodOptional<z.ZodString>;
|
|
15
|
+
annotations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
sailingNotes: z.ZodOptional<z.ZodString>;
|
|
15
17
|
sailings: z.ZodArray<z.ZodObject<{
|
|
16
18
|
departureTime: z.ZodOptional<z.ZodString>;
|
|
17
19
|
arrivalTime: z.ZodOptional<z.ZodString>;
|
|
18
20
|
vesselName: z.ZodOptional<z.ZodString>;
|
|
21
|
+
vesselId: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
loadingRule: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
vesselHandicapAccessible: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
annotationIndexes: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
19
25
|
}, z.core.$strip>>;
|
|
20
26
|
}, z.core.$strip>, readonly [{
|
|
21
27
|
readonly reason: "api_unavailable";
|
|
@@ -35,12 +41,13 @@ export declare const getFerrySchedule: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
35
41
|
readonly reason: "invalid_terminal_pair";
|
|
36
42
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
37
43
|
readonly when: "The terminal ID pair is invalid or does not form a valid ferry route.";
|
|
38
|
-
readonly recovery: "
|
|
44
|
+
readonly recovery: "Call wsdot_get_ferry_routes for the same tripDate and pick a departing → arriving pair from a route’s terminalPairs; wsdot_get_ferry_terminals maps terminal names to IDs.";
|
|
39
45
|
}, {
|
|
40
46
|
readonly reason: "invalid_date";
|
|
41
47
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
42
|
-
readonly when: "The
|
|
43
|
-
readonly
|
|
48
|
+
readonly when: "The tripDate is not a valid YYYY-MM-DD date, WSF rejects it as outside the dates it has published a schedule for, or WSF lists no routes on it.";
|
|
49
|
+
readonly retryable: false;
|
|
50
|
+
readonly recovery: "Use a YYYY-MM-DD date from today (Pacific time) through the end of the posted schedule, on which wsdot_get_ferry_routes lists routes; when WSF rejects the date, the message states the range it accepts.";
|
|
44
51
|
}], {
|
|
45
52
|
readonly tripDate: z.ZodString;
|
|
46
53
|
readonly remainingOnly: z.ZodBoolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ferry-schedule.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-schedule.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAI3E,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"get-ferry-schedule.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-schedule.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAI3E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8R3B,CAAC"}
|
|
@@ -8,9 +8,12 @@ import { FerryApiService, getFerryApiService } from '../../../services/ferry/fer
|
|
|
8
8
|
export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
9
9
|
title: 'Get Ferry Schedule',
|
|
10
10
|
description: 'Returns departure times for a specific WSF ferry route on a given date. ' +
|
|
11
|
-
'Requires numeric terminal IDs — use wsdot_get_ferry_terminals to resolve terminal names to IDs
|
|
11
|
+
'Requires numeric terminal IDs — use wsdot_get_ferry_terminals to resolve terminal names to IDs; ' +
|
|
12
|
+
'terminalPairs on wsdot_get_ferry_routes lists the pairs with service on a date. ' +
|
|
12
13
|
'Set remainingOnly to true to show only future departures for today (useful for "next ferry" queries). ' +
|
|
13
14
|
'For future dates, all sailings for that day are returned. ' +
|
|
15
|
+
"Each sailing carries its vessel ID, WSF's loading-rule code, and the pair's annotations that " +
|
|
16
|
+
'apply to it — notes such as "No interisland vehicles" that decide whether a sailing takes a car. ' +
|
|
14
17
|
'Sailing times are ISO 8601 UTC while tripDate is the Pacific service day, so evening sailings ' +
|
|
15
18
|
'carry the next UTC date — convert to America/Los_Angeles before quoting a clock time. ' +
|
|
16
19
|
'Cancellations are not carried here — WSF drops a cancelled sailing from the schedule instead ' +
|
|
@@ -40,6 +43,17 @@ export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
|
40
43
|
output: z.object({
|
|
41
44
|
departingTerminalName: z.string().optional().describe('Departing terminal name.'),
|
|
42
45
|
arrivingTerminalName: z.string().optional().describe('Arriving terminal name.'),
|
|
46
|
+
annotations: z
|
|
47
|
+
.array(z.string().describe('One note, as plain text.'))
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Notes WSF attaches to this pair's sailings (vehicle restrictions, routing, delays), converted " +
|
|
50
|
+
'from HTML to plain text with link destinations kept as "text (url)". Sailings point at the ' +
|
|
51
|
+
'ones that apply to them through annotationIndexes. Empty when the pair has none.'),
|
|
52
|
+
sailingNotes: z
|
|
53
|
+
.string()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('A note covering every sailing on this pair (e.g. a boarding-pass requirement), converted from ' +
|
|
56
|
+
'HTML to plain text. Absent when WSF publishes none, which is the case for most pairs.'),
|
|
43
57
|
sailings: z
|
|
44
58
|
.array(z
|
|
45
59
|
.object({
|
|
@@ -55,13 +69,34 @@ export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
|
55
69
|
.describe('Scheduled arrival time (ISO 8601, UTC), on the same terms as departureTime. ' +
|
|
56
70
|
'Absent on the routes WSF publishes no arrival time for.'),
|
|
57
71
|
vesselName: z.string().optional().describe('Vessel assigned to this sailing.'),
|
|
72
|
+
vesselId: z
|
|
73
|
+
.number()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe('ID of the assigned vessel — the same vesselId wsdot_get_vessel_locations reports.'),
|
|
76
|
+
loadingRule: z
|
|
77
|
+
.number()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe("WSF's loading-rule code for this sailing. WSF does not document the codes: 3 appears on " +
|
|
80
|
+
'nearly every sailing, and 1 has appeared only on sailings whose annotation restricts ' +
|
|
81
|
+
'vehicles. Read the sailing’s annotations for the restriction itself.'),
|
|
82
|
+
vesselHandicapAccessible: z
|
|
83
|
+
.boolean()
|
|
84
|
+
.optional()
|
|
85
|
+
.describe('Whether WSF marks the assigned vessel as handicap accessible.'),
|
|
86
|
+
annotationIndexes: z
|
|
87
|
+
.array(z.number().describe('A position in annotations.'))
|
|
88
|
+
.optional()
|
|
89
|
+
.describe('Positions in annotations of the notes that apply to this sailing; each resolves to an ' +
|
|
90
|
+
'entry. Empty when none apply.'),
|
|
58
91
|
})
|
|
59
|
-
.describe('One scheduled sailing with departure time and
|
|
92
|
+
.describe('One scheduled sailing with departure time, vessel assignment, and the notes that apply to it.'))
|
|
60
93
|
.describe('Scheduled sailings for this route and date.'),
|
|
61
94
|
}),
|
|
62
95
|
enrichment: {
|
|
63
96
|
tripDate: z.string().describe('Date of the schedule (ISO 8601).'),
|
|
64
|
-
remainingOnly: z
|
|
97
|
+
remainingOnly: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.describe("Whether the result holds only today's remaining sailings. False for any date other than today, whatever was requested."),
|
|
65
100
|
totalSailings: z.number().describe('Total number of sailings returned.'),
|
|
66
101
|
notice: z
|
|
67
102
|
.string()
|
|
@@ -89,13 +124,14 @@ export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
|
89
124
|
reason: 'invalid_terminal_pair',
|
|
90
125
|
code: JsonRpcErrorCode.ValidationError,
|
|
91
126
|
when: 'The terminal ID pair is invalid or does not form a valid ferry route.',
|
|
92
|
-
recovery: '
|
|
127
|
+
recovery: 'Call wsdot_get_ferry_routes for the same tripDate and pick a departing → arriving pair from a route’s terminalPairs; wsdot_get_ferry_terminals maps terminal names to IDs.',
|
|
93
128
|
},
|
|
94
129
|
{
|
|
95
130
|
reason: 'invalid_date',
|
|
96
131
|
code: JsonRpcErrorCode.ValidationError,
|
|
97
|
-
when: 'The
|
|
98
|
-
|
|
132
|
+
when: 'The tripDate is not a valid YYYY-MM-DD date, WSF rejects it as outside the dates it has published a schedule for, or WSF lists no routes on it.',
|
|
133
|
+
retryable: false,
|
|
134
|
+
recovery: 'Use a YYYY-MM-DD date from today (Pacific time) through the end of the posted schedule, on which wsdot_get_ferry_routes lists routes; when WSF rejects the date, the message states the range it accepts.',
|
|
99
135
|
},
|
|
100
136
|
],
|
|
101
137
|
async handler(input, ctx) {
|
|
@@ -108,24 +144,32 @@ export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
|
108
144
|
catch {
|
|
109
145
|
throw ctx.fail('invalid_date', `Invalid date: "${input.tripDate}". Expected YYYY-MM-DD format (e.g. 2026-05-23).`, { ...ctx.recoveryFor('invalid_date') });
|
|
110
146
|
}
|
|
111
|
-
const
|
|
147
|
+
const service = getFerryApiService();
|
|
112
148
|
let schedule;
|
|
113
149
|
try {
|
|
114
|
-
schedule = await
|
|
150
|
+
schedule = await service.getSchedule(input.departingTerminalId, input.arrivingTerminalId, tripDate, input.remainingOnly ?? false, ctx);
|
|
115
151
|
}
|
|
116
152
|
catch (err) {
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
153
|
+
// The service has already classified an unregistered access code (a server configuration
|
|
154
|
+
// fault) and a trip date outside WSF's window; both keep their own reason.
|
|
155
|
+
if (!(err instanceof McpError))
|
|
156
|
+
throw err;
|
|
157
|
+
const reason = err.data?.reason;
|
|
158
|
+
if (reason === 'invalid_access_code' || reason === 'invalid_date')
|
|
122
159
|
throw err;
|
|
160
|
+
// What remains of a rejection — a 200 + {"Message"} body (→ "WSF Ferry API error: …") or a
|
|
161
|
+
// real HTTP 4xx — means there is no schedule for this pair on this date.
|
|
123
162
|
const status = err.data?.status;
|
|
124
|
-
const
|
|
163
|
+
const rejected = err.message.includes('WSF Ferry API error') ||
|
|
125
164
|
(typeof status === 'number' && status >= 400 && status < 500);
|
|
126
|
-
if (!
|
|
165
|
+
if (!rejected)
|
|
127
166
|
throw err;
|
|
128
|
-
|
|
167
|
+
// WSF rejects every pair on an in-window date whose season has no sailings loaded, in the
|
|
168
|
+
// same words it uses for a pair that never has service. The date's route list tells them apart.
|
|
169
|
+
if (!(await service.hasRoutes(tripDate, ctx))) {
|
|
170
|
+
throw ctx.fail('invalid_date', `WSF lists no routes on ${tripDate}, so no terminal pair has a schedule that day. The date is inside the window WSF accepts, but no sailings are loaded for it yet.`, { ...ctx.recoveryFor('invalid_date') }, { cause: err });
|
|
171
|
+
}
|
|
172
|
+
throw ctx.fail('invalid_terminal_pair', `No ferry schedule for terminal ${input.departingTerminalId} → ${input.arrivingTerminalId} on ${tripDate}. These terminals may not have direct service, or a terminal ID may be invalid.`, { ...ctx.recoveryFor('invalid_terminal_pair') }, { cause: err });
|
|
129
173
|
}
|
|
130
174
|
ctx.log.info('Ferry schedule fetched', {
|
|
131
175
|
departingTerminalId: input.departingTerminalId,
|
|
@@ -133,15 +177,18 @@ export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
|
133
177
|
tripDate,
|
|
134
178
|
sailingsCount: schedule.sailings.length,
|
|
135
179
|
});
|
|
180
|
+
const { remainingOnly } = schedule;
|
|
136
181
|
ctx.enrich({ tripDate, remainingOnly, totalSailings: schedule.sailings.length });
|
|
137
182
|
if (schedule.sailings.length === 0) {
|
|
138
183
|
ctx.enrich.notice(remainingOnly
|
|
139
184
|
? `No remaining sailings today for this terminal pair (${tripDate}). The last sailing may have departed — check wsdot_get_ferry_schedule without remainingOnly for the full day's schedule.`
|
|
140
|
-
: `No sailings found for this terminal pair on ${tripDate}.
|
|
185
|
+
: `No sailings found for this terminal pair on ${tripDate}. Check the pair against terminalPairs from wsdot_get_ferry_routes for ${tripDate}.`);
|
|
141
186
|
}
|
|
142
187
|
return {
|
|
143
188
|
departingTerminalName: schedule.departingTerminalName,
|
|
144
189
|
arrivingTerminalName: schedule.arrivingTerminalName,
|
|
190
|
+
...(schedule.annotations && { annotations: schedule.annotations }),
|
|
191
|
+
...(schedule.sailingNotes && { sailingNotes: schedule.sailingNotes }),
|
|
145
192
|
sailings: schedule.sailings,
|
|
146
193
|
};
|
|
147
194
|
},
|
|
@@ -149,11 +196,23 @@ export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
|
149
196
|
const route = result.departingTerminalName && result.arrivingTerminalName
|
|
150
197
|
? `${result.departingTerminalName} → ${result.arrivingTerminalName}`
|
|
151
198
|
: 'Ferry Schedule';
|
|
199
|
+
/** A note on a list item's own line, with any line breaks it holds kept under that item. */
|
|
200
|
+
const note = (index, indent) => `${indent}- [${index}] ${(result.annotations?.[index] ?? 'not listed in annotations').replaceAll('\n', `\n${indent} `)}`;
|
|
152
201
|
const lines = [`## Ferry Schedule — ${route}`];
|
|
153
202
|
if (result.departingTerminalName)
|
|
154
203
|
lines.push(`**From:** ${result.departingTerminalName}`);
|
|
155
204
|
if (result.arrivingTerminalName)
|
|
156
205
|
lines.push(`**To:** ${result.arrivingTerminalName}`);
|
|
206
|
+
if (result.sailingNotes)
|
|
207
|
+
lines.push(`**Sailing notes:** ${result.sailingNotes}`);
|
|
208
|
+
if (result.annotations?.length === 0) {
|
|
209
|
+
lines.push('**Annotations:** none');
|
|
210
|
+
}
|
|
211
|
+
else if (result.annotations) {
|
|
212
|
+
lines.push('**Annotations** (sailings below cite them by index):');
|
|
213
|
+
for (const i of result.annotations.keys())
|
|
214
|
+
lines.push(note(i, ''));
|
|
215
|
+
}
|
|
157
216
|
lines.push('');
|
|
158
217
|
if (result.sailings.length === 0) {
|
|
159
218
|
lines.push('No sailings found for this route and date.');
|
|
@@ -162,8 +221,19 @@ export const getFerrySchedule = tool('wsdot_get_ferry_schedule', {
|
|
|
162
221
|
for (const s of result.sailings) {
|
|
163
222
|
const dep = s.departureTime ?? 'Unknown';
|
|
164
223
|
const arr = s.arrivalTime ? ` → ${s.arrivalTime}` : '';
|
|
165
|
-
const vessel = s.vesselName ? `
|
|
166
|
-
|
|
224
|
+
const vessel = [s.vesselName, s.vesselId != null ? `(vesselId ${s.vesselId})` : undefined]
|
|
225
|
+
.filter(Boolean)
|
|
226
|
+
.join(' ');
|
|
227
|
+
const details = [
|
|
228
|
+
vessel,
|
|
229
|
+
s.loadingRule != null ? `loadingRule ${s.loadingRule}` : undefined,
|
|
230
|
+
s.vesselHandicapAccessible != null
|
|
231
|
+
? `vesselHandicapAccessible: ${s.vesselHandicapAccessible}`
|
|
232
|
+
: undefined,
|
|
233
|
+
].filter(Boolean);
|
|
234
|
+
lines.push(`- ${dep}${arr}${details.map((d) => ` | ${d}`).join('')}`);
|
|
235
|
+
for (const i of s.annotationIndexes ?? [])
|
|
236
|
+
lines.push(note(i, ' '));
|
|
167
237
|
}
|
|
168
238
|
}
|
|
169
239
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ferry-schedule.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-schedule.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAC/D,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,0EAA0E;QAC1E,kGAAkG;QAClG,wGAAwG;QACxG,4DAA4D;QAC5D,gGAAgG;QAChG,wFAAwF;QACxF,+FAA+F;QAC/F,kFAAkF;QAClF,iGAAiG;IACnG,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,mBAAmB,EAAE,CAAC;aACnB,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CACP,8FAA8F,CAC/F;QACH,kBAAkB,EAAE,CAAC;aAClB,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CAAC,sCAAsC,CAAC;QACnD,QAAQ,EAAE,CAAC;aACR,M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E,CAAC;QACH,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { z } from '@cyanheads/mcp-ts-core';
|
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
export declare const getFerryTerminals: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
8
8
|
terminals: z.ZodArray<z.ZodObject<{
|
|
9
|
-
terminalId: z.ZodNumber
|
|
10
|
-
terminalName: z.ZodString
|
|
9
|
+
terminalId: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
terminalName: z.ZodOptional<z.ZodString>;
|
|
11
11
|
terminalAbbrev: z.ZodOptional<z.ZodString>;
|
|
12
12
|
latitude: z.ZodOptional<z.ZodNumber>;
|
|
13
13
|
longitude: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ferry-terminals.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-terminals.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-ferry-terminals.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-terminals.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;EA+F5B,CAAC"}
|