@cyanheads/wsdot-mcp-server 0.2.0 → 0.2.2
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 +10 -2
- package/changelog/0.2.x/0.2.1.md +16 -0
- package/changelog/0.2.x/0.2.2.md +15 -0
- package/dist/mcp-server/tools/definitions/get-ferry-alerts.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/get-ferry-alerts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-alerts.tool.js +30 -3
- package/dist/mcp-server/tools/definitions/get-ferry-alerts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.js +61 -7
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.d.ts +6 -1
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.js +49 -9
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.js +51 -7
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-alerts.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/search-alerts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-alerts.tool.js +65 -10
- package/dist/mcp-server/tools/definitions/search-alerts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-cameras.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-cameras.tool.js +7 -2
- package/dist/mcp-server/tools/definitions/search-cameras.tool.js.map +1 -1
- package/dist/services/ferry/ferry-service.d.ts.map +1 -1
- package/dist/services/ferry/ferry-service.js +24 -11
- package/dist/services/ferry/ferry-service.js.map +1 -1
- package/dist/services/ferry/types.d.ts +19 -2
- package/dist/services/ferry/types.d.ts.map +1 -1
- package/dist/services/html-text.d.ts +31 -0
- package/dist/services/html-text.d.ts.map +1 -0
- package/dist/services/html-text.js +285 -0
- package/dist/services/html-text.js.map +1 -0
- package/dist/services/traffic/stable-order.d.ts +20 -0
- package/dist/services/traffic/stable-order.d.ts.map +1 -0
- package/dist/services/traffic/stable-order.js +29 -0
- package/dist/services/traffic/stable-order.js.map +1 -0
- package/dist/services/traffic/traffic-service.d.ts.map +1 -1
- package/dist/services/traffic/traffic-service.js +17 -2
- package/dist/services/traffic/traffic-service.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.2.
|
|
4
|
+
**Version:** 0.2.2
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.0`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** @cyanheads/wsdot-mcp-server
|
|
4
|
-
**Version:** 0.2.
|
|
4
|
+
**Version:** 0.2.2
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.0`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
|
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
|
|
|
@@ -60,6 +60,8 @@ Active WA highway alerts — incidents, construction, closures, restrictions.
|
|
|
60
60
|
- Filter by WSDOT region: Northwest, Olympic, Southwest, South Central, North Central, Eastern
|
|
61
61
|
- Filter by milepost range to scope to a corridor — an alert matches when its extent overlaps the range, so a closure that spans the boundary is returned
|
|
62
62
|
- Omit all filters to return all current statewide alerts
|
|
63
|
+
- Descriptions are plain text — upstream authors them with markup, and a link is rendered inline as `link text (url)` so the destination survives
|
|
64
|
+
- Results are ordered by `alertId` and paged (default 50, max 500) — pass `offset`/`limit` to page through the full statewide set; the notice reports the next offset. Upstream returns the same alert set in more than one row order, so the ordering is imposed here to keep a given offset reproducible
|
|
63
65
|
|
|
64
66
|
---
|
|
65
67
|
|
|
@@ -71,6 +73,7 @@ Current vs. average travel times for named WA highway corridors.
|
|
|
71
73
|
- Filter by route (`"I-5"`, `"5"`, `"SR 520"`) to get every corridor measured on it, or by any text to match corridor names (`"Everett"`)
|
|
72
74
|
- When current time exceeds average, the corridor is congested; the delta is the delay
|
|
73
75
|
- Reversible express-lane corridors report no travel time while closed in the queried direction — those figures are omitted rather than reported as zero minutes
|
|
76
|
+
- Results are paged (default 50, max 500) — pass `offset`/`limit` to page through the full statewide set; the notice reports the next offset
|
|
74
77
|
|
|
75
78
|
---
|
|
76
79
|
|
|
@@ -80,6 +83,7 @@ Current dynamic toll rates for WA tolled facilities.
|
|
|
80
83
|
|
|
81
84
|
- SR 99 (WSDOT Tunnel), SR 520 Bridge, I-405 Express Lanes, I-90 Two-Way Express Lanes, SR 167 HOT Lanes
|
|
82
85
|
- Rates are time-banded and change dynamically based on traffic conditions
|
|
86
|
+
- Results are paged (default 50, max 500) — pass `offset`/`limit` to page through the full statewide set; the notice reports the next offset
|
|
83
87
|
|
|
84
88
|
---
|
|
85
89
|
|
|
@@ -100,7 +104,7 @@ WSDOT highway camera metadata and image URLs.
|
|
|
100
104
|
- Filter by state route (`"I-90"`, `"90"`, `"SR 520"`, or `"520"` all work), WSDOT region, or milepost range
|
|
101
105
|
- Camera road names carry a route-type prefix, so `"SR 26"` excludes US 26 and `"US 97"` excludes US 97A; a bare `"26"` returns both
|
|
102
106
|
- Returns metadata and image URLs — camera images are copyright WSDOT, not fetched as bytes
|
|
103
|
-
- Results are paged (default 50, max 500) — pass `offset`/`limit` to page through the full statewide set; the notice reports the next offset
|
|
107
|
+
- Results are ordered by `cameraId` and paged (default 50, max 500) — pass `offset`/`limit` to page through the full statewide set; the notice reports the next offset. Upstream returns the same camera set in more than one row order, so the ordering is imposed here to keep a given offset reproducible
|
|
104
108
|
|
|
105
109
|
---
|
|
106
110
|
|
|
@@ -152,6 +156,7 @@ Real-time vehicle space availability at WSF terminals for upcoming sailings.
|
|
|
152
156
|
- `arrivingTerminalIds` lists the terminals a sailing serves and chains straight into `wsdot_get_ferry_schedule`; `itineraryLabel` is a display string that may name several stops, not a single destination
|
|
153
157
|
- Filter to a specific terminal by ID (from `wsdot_get_ferry_terminals`)
|
|
154
158
|
- Use for "will I make the ferry?" or "how full is the next sailing?" queries
|
|
159
|
+
- Results are paged by terminal (default 5, max 20) — `offset`/`limit` select whole terminals and `totalCount` counts matching terminals, not sailings; every sailing of a returned terminal is included, so page size varies with how many departures each terminal carries
|
|
155
160
|
|
|
156
161
|
---
|
|
157
162
|
|
|
@@ -159,7 +164,10 @@ Real-time vehicle space availability at WSF terminals for upcoming sailings.
|
|
|
159
164
|
|
|
160
165
|
Active WSF ferry service disruptions, delays, and bulletins.
|
|
161
166
|
|
|
167
|
+
- Each alert carries the bulletin's `alertTitle`, its one-line `alertDescription`, and the full `bulletinText` — detail such as a replacement sailing appears only in the body
|
|
168
|
+
- `bulletinText` is plain text: upstream authors it as HTML, and a link is rendered inline as `link text (url)`
|
|
162
169
|
- Each alert includes `impactedRouteIds` — cross-reference with `wsdot_get_ferry_routes` to map route IDs to names
|
|
170
|
+
- `affectsAllRoutes: true` marks a fleet-wide alert, which need not enumerate routes — an empty `impactedRouteIds` then means every route rather than none
|
|
163
171
|
|
|
164
172
|
---
|
|
165
173
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "`wsdot_search_alerts` normalizes upstream HTML in `headlineDescription`/`extendedDescription` to plain text, preserving link destinations (#22); `wsdot_get_ferry_alerts` surfaces `alertTitle`, `bulletinText`, `alertType`, and `affectsAllRoutes` (#34)."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.1 — 2026-07-30
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **Shared HTML-to-text normalizer (`src/services/html-text.ts`).** A hand-written single-pass scanner rather than a dependency — the two framework sanitization helpers are both async, which would make the normalizers async throughout. A destination whose scheme isn't `http`/`https`/`mailto`/`tel` is dropped while the anchor's text is kept; control characters inside a destination are stripped before the scheme check; a destination still carrying an entity this decoder doesn't resolve is rejected rather than passed through.
|
|
12
|
+
- **`wsdot_get_ferry_alerts` surfaces bulletin detail.** `alertTitle` (from `AlertFullTitle`), `bulletinText` (the bulletin body, HTML normalized to plain text), `alertType` (e.g. "All Alerts"), and `affectsAllRoutes` (from `AllRoutesFlag`) are now mapped alongside the existing `alertDescription` summary. `bulletinText` is the only place detail such as a replacement sailing appears. `affectsAllRoutes` disambiguates an empty `impactedRouteIds`: `format()` now renders "all routes — this alert affects the whole fleet" when true, and "none listed — this alert names no specific route" when false with no routes ([#34](https://github.com/cyanheads/wsdot-mcp-server/issues/34)).
|
|
13
|
+
|
|
14
|
+
## Fixed
|
|
15
|
+
|
|
16
|
+
- **`wsdot_search_alerts` no longer leaks upstream HTML.** `headlineDescription` and `extendedDescription` are normalized to plain text before either response path reads them — an anchor renders as `link text (url)`, keeping the destination. A description that normalizes to nothing is now omitted rather than sent as an empty string. `format()` also puts only the first line of a multi-paragraph headline in the `###` heading, so the trailing alert ID no longer lands mid-paragraph ([#22](https://github.com/cyanheads/wsdot-mcp-server/issues/22)).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "`offset`/`limit` paging added to `wsdot_search_alerts`, `wsdot_get_travel_times`, `wsdot_get_toll_rates`, and `wsdot_get_terminal_space` (#24); `wsdot_search_alerts` and `wsdot_search_cameras` now impose a deterministic row order before paging, which changes their default result order."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.2 — 2026-07-30
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`offset`/`limit` paging on four more tools.** `wsdot_search_alerts`, `wsdot_get_travel_times`, and `wsdot_get_toll_rates` page at the row level (default 50, max 500); `wsdot_get_terminal_space` pages at the terminal level (default 5, max 20), since each terminal carries every sailing it reports. All four follow the contract `wsdot_search_cameras` already used: paging happens in the handler after every filter, `enrichment.totalCount` stays the full filtered count, and `nextOffset`/`hasMore`/a page-window notice reach both `structuredContent` and `content[]` ([#24](https://github.com/cyanheads/wsdot-mcp-server/issues/24)).
|
|
12
|
+
|
|
13
|
+
## Fixed
|
|
14
|
+
|
|
15
|
+
- **`wsdot_search_alerts` and `wsdot_search_cameras` now page in a stable order.** Live verification found both feeds serve the same row set in more than one order across repeated fetches — since every page is a separate upstream fetch, an unordered offset silently skipped and duplicated rows across a walk. Both tools now sort by `alertId`/`cameraId` (`src/services/traffic/stable-order.ts`, rows without an id sorting last) before slicing, making a given offset reproducible. **This changes the default result order of both tools for every existing caller.**
|
|
@@ -7,7 +7,11 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
7
|
export declare const getFerryAlerts: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
8
8
|
alerts: z.ZodArray<z.ZodObject<{
|
|
9
9
|
alertId: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
alertTitle: z.ZodOptional<z.ZodString>;
|
|
10
11
|
alertDescription: z.ZodOptional<z.ZodString>;
|
|
12
|
+
bulletinText: z.ZodOptional<z.ZodString>;
|
|
13
|
+
alertType: z.ZodOptional<z.ZodString>;
|
|
14
|
+
affectsAllRoutes: z.ZodOptional<z.ZodBoolean>;
|
|
11
15
|
impactedRouteIds: z.ZodArray<z.ZodNumber>;
|
|
12
16
|
publishDate: z.ZodOptional<z.ZodString>;
|
|
13
17
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ferry-alerts.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-alerts.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-alerts.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-alerts.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;;;;;;;;;;;;;;;;;;;;;;;;;;EAwHzB,CAAC"}
|
|
@@ -8,6 +8,8 @@ import { getFerryApiService } from '../../../services/ferry/ferry-service.js';
|
|
|
8
8
|
export const getFerryAlerts = tool('wsdot_get_ferry_alerts', {
|
|
9
9
|
title: 'Get Ferry Alerts',
|
|
10
10
|
description: 'Returns active WSF ferry service disruptions, delays, and bulletins. ' +
|
|
11
|
+
'Each alert carries a one-line summary plus the bulletin title, kind, and full body — the body ' +
|
|
12
|
+
'is where detail such as a replacement sailing appears. ' +
|
|
11
13
|
'Each alert includes impacted route IDs — cross-reference with wsdot_get_ferry_routes ' +
|
|
12
14
|
'to resolve route IDs to human-readable route names. Some IDs (seasonal, San Juan interisland, ' +
|
|
13
15
|
'or international Sidney B.C. routes) may not appear in wsdot_get_ferry_routes for a given date.',
|
|
@@ -18,14 +20,28 @@ export const getFerryAlerts = tool('wsdot_get_ferry_alerts', {
|
|
|
18
20
|
.array(z
|
|
19
21
|
.object({
|
|
20
22
|
alertId: z.number().optional().describe('Unique alert identifier.'),
|
|
23
|
+
alertTitle: z.string().optional().describe("The bulletin's own title."),
|
|
21
24
|
alertDescription: z
|
|
22
25
|
.string()
|
|
23
26
|
.optional()
|
|
24
|
-
.describe('
|
|
27
|
+
.describe('One-line summary of the alert or disruption, as shown on the route pages. Falls back to the title when upstream publishes no summary.'),
|
|
28
|
+
bulletinText: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Full bulletin body as plain text, normalized from the upstream HTML — links are rendered inline as "link text (url)". Detail that appears nowhere else, such as a replacement sailing, lives here.'),
|
|
32
|
+
alertType: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe('Alert kind as WSF categorizes it, e.g. "All Alerts".'),
|
|
36
|
+
affectsAllRoutes: z
|
|
37
|
+
.boolean()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('True when the alert applies fleet-wide. A fleet-wide alert need not enumerate routes, so while this is true an empty impactedRouteIds means every route rather than none.'),
|
|
25
40
|
impactedRouteIds: z
|
|
26
41
|
.array(z.number())
|
|
27
42
|
.describe('Route IDs affected by this alert. Cross-reference with wsdot_get_ferry_routes to get route names; ' +
|
|
28
|
-
'some seasonal or interisland route IDs may not be listed there for a given date.'
|
|
43
|
+
'some seasonal or interisland route IDs may not be listed there for a given date. ' +
|
|
44
|
+
'Empty means no specific routes unless affectsAllRoutes is true, which makes it fleet-wide.'),
|
|
29
45
|
publishDate: z.string().optional().describe('When the alert was published (ISO 8601).'),
|
|
30
46
|
})
|
|
31
47
|
.describe('A WSF ferry service alert or disruption.'))
|
|
@@ -70,12 +86,23 @@ export const getFerryAlerts = tool('wsdot_get_ferry_alerts', {
|
|
|
70
86
|
const lines = [];
|
|
71
87
|
for (const a of result.alerts) {
|
|
72
88
|
const id = a.alertId != null ? ` #${a.alertId}` : '';
|
|
73
|
-
lines.push(`### Alert${id}`);
|
|
89
|
+
lines.push(`### ${a.alertTitle ?? 'Alert'}${id}`);
|
|
90
|
+
if (a.alertType)
|
|
91
|
+
lines.push(`**Type:** ${a.alertType}`);
|
|
74
92
|
if (a.alertDescription)
|
|
75
93
|
lines.push(a.alertDescription);
|
|
94
|
+
if (a.bulletinText)
|
|
95
|
+
lines.push(a.bulletinText);
|
|
76
96
|
if (a.impactedRouteIds.length > 0) {
|
|
77
97
|
lines.push(`**Impacted Route IDs:** ${a.impactedRouteIds.join(', ')} (use wsdot_get_ferry_routes to look up names)`);
|
|
78
98
|
}
|
|
99
|
+
// An alert with no route IDs is ambiguous on its own — say which of the two it is.
|
|
100
|
+
if (a.affectsAllRoutes) {
|
|
101
|
+
lines.push('**Impacted Routes:** all routes — this alert affects the whole fleet.');
|
|
102
|
+
}
|
|
103
|
+
else if (a.affectsAllRoutes === false && a.impactedRouteIds.length === 0) {
|
|
104
|
+
lines.push('**Impacted Routes:** none listed — this alert names no specific route.');
|
|
105
|
+
}
|
|
79
106
|
if (a.publishDate)
|
|
80
107
|
lines.push(`**Published:** ${a.publishDate}`);
|
|
81
108
|
lines.push('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ferry-alerts.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-alerts.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,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,wBAAwB,EAAE;IAC3D,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,uEAAuE;QACvE,uFAAuF;QACvF,gGAAgG;QAChG,iGAAiG;IACnG,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC;aACN,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YACnE,gBAAgB,EAAE,CAAC;iBAChB,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"get-ferry-alerts.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-ferry-alerts.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,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,wBAAwB,EAAE;IAC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AAC,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"}
|
|
@@ -6,6 +6,8 @@ import { z } from '@cyanheads/mcp-ts-core';
|
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
export declare const getTerminalSpace: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
8
|
departingTerminalId: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
9
11
|
}, z.core.$strip>, z.ZodObject<{
|
|
10
12
|
terminals: z.ZodArray<z.ZodObject<{
|
|
11
13
|
terminalId: z.ZodOptional<z.ZodNumber>;
|
|
@@ -38,6 +40,8 @@ export declare const getTerminalSpace: import("@cyanheads/mcp-ts-core").ToolDefi
|
|
|
38
40
|
readonly recovery: "Register an access code at https://wsdot.wa.gov/traffic/api/, set WSDOT_ACCESS_CODE on the server, and restart it.";
|
|
39
41
|
}], {
|
|
40
42
|
readonly totalCount: z.ZodNumber;
|
|
43
|
+
readonly nextOffset: z.ZodNullable<z.ZodNumber>;
|
|
44
|
+
readonly hasMore: z.ZodBoolean;
|
|
41
45
|
readonly terminalFilter: z.ZodOptional<z.ZodNumber>;
|
|
42
46
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
43
47
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-terminal-space.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-terminal-space.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-terminal-space.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-terminal-space.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAWjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsP3B,CAAC"}
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { getFerryApiService } from '../../../services/ferry/ferry-service.js';
|
|
8
|
+
/**
|
|
9
|
+
* Paging unit is the terminal, not the sailing: offset/limit select whole terminals and each
|
|
10
|
+
* one arrives with every upcoming sailing it reports. WSF operates roughly 20 terminals, so
|
|
11
|
+
* MAX_LIMIT reaches the entire set in one call while the default bounds a browse of all of them.
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_LIMIT = 5;
|
|
14
|
+
const MAX_LIMIT = 20;
|
|
8
15
|
export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
9
16
|
title: 'Get Terminal Space',
|
|
10
17
|
description: 'Returns real-time drive-up and reservable vehicle space available at WSF terminals for upcoming sailings. ' +
|
|
@@ -12,13 +19,29 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
12
19
|
'Optionally filter to a specific terminal by ID (use wsdot_get_ferry_terminals for the ID). ' +
|
|
13
20
|
'driveUpSpaceCount is the key field — zero means the drive-up lane is full. ' +
|
|
14
21
|
'Destinations are arrivingTerminalIds, not the itineraryLabel string: a sailing can serve ' +
|
|
15
|
-
'several terminals, and those IDs are what wsdot_get_ferry_schedule accepts.'
|
|
22
|
+
'several terminals, and those IDs are what wsdot_get_ferry_schedule accepts. ' +
|
|
23
|
+
`Results are paged by terminal (default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}): offset/limit select whole terminals ` +
|
|
24
|
+
'and totalCount counts matching terminals, not sailings — every sailing of a returned terminal is included, ' +
|
|
25
|
+
'so page size varies with how many departures each terminal carries.',
|
|
16
26
|
annotations: { readOnlyHint: true },
|
|
17
27
|
input: z.object({
|
|
18
28
|
departingTerminalId: z
|
|
19
29
|
.number()
|
|
20
30
|
.optional()
|
|
21
31
|
.describe('Filter to a specific terminal by numeric ID. Omit to return all terminals.'),
|
|
32
|
+
offset: z
|
|
33
|
+
.number()
|
|
34
|
+
.int()
|
|
35
|
+
.min(0)
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Zero-based index of the first terminal to return, for paging. Defaults to 0.'),
|
|
38
|
+
limit: z
|
|
39
|
+
.number()
|
|
40
|
+
.int()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(MAX_LIMIT)
|
|
43
|
+
.optional()
|
|
44
|
+
.describe(`Maximum terminals to return in this page (1–${MAX_LIMIT}). Defaults to ${DEFAULT_LIMIT}. Counts terminals, not sailings.`),
|
|
22
45
|
}),
|
|
23
46
|
output: z.object({
|
|
24
47
|
terminals: z
|
|
@@ -78,7 +101,14 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
78
101
|
.describe('Terminal space availability by terminal.'),
|
|
79
102
|
}),
|
|
80
103
|
enrichment: {
|
|
81
|
-
totalCount: z
|
|
104
|
+
totalCount: z
|
|
105
|
+
.number()
|
|
106
|
+
.describe('Total terminals matching the filter across all pages (not just this page). Counts terminals, not sailings.'),
|
|
107
|
+
nextOffset: z
|
|
108
|
+
.number()
|
|
109
|
+
.nullable()
|
|
110
|
+
.describe('Offset to pass to retrieve the next page, or null when this is the last page.'),
|
|
111
|
+
hasMore: z.boolean().describe('True when more terminals remain beyond the current page.'),
|
|
82
112
|
terminalFilter: z
|
|
83
113
|
.number()
|
|
84
114
|
.optional()
|
|
@@ -86,7 +116,7 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
86
116
|
notice: z
|
|
87
117
|
.string()
|
|
88
118
|
.optional()
|
|
89
|
-
.describe('
|
|
119
|
+
.describe('Informational note about the page window, or guidance when no terminal space data is available, the filter matched nothing, or the offset ran past the end.'),
|
|
90
120
|
},
|
|
91
121
|
errors: [
|
|
92
122
|
{
|
|
@@ -109,17 +139,41 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
109
139
|
const filtered = input.departingTerminalId != null
|
|
110
140
|
? all.filter((t) => t.terminalId === input.departingTerminalId)
|
|
111
141
|
: all;
|
|
112
|
-
|
|
142
|
+
// Page the filtered set at the terminal level so structuredContent and content[] carry the
|
|
143
|
+
// identical page and no terminal's sailings are split across two calls (the service stays
|
|
144
|
+
// filter-only; paging is a tool-handler concern). totalCount stays the full match count.
|
|
145
|
+
const totalCount = filtered.length;
|
|
146
|
+
const offset = input.offset ?? 0;
|
|
147
|
+
const limit = input.limit ?? DEFAULT_LIMIT;
|
|
148
|
+
const terminals = filtered.slice(offset, offset + limit);
|
|
149
|
+
const hasMore = offset + terminals.length < totalCount;
|
|
150
|
+
const nextOffset = hasMore ? offset + terminals.length : null;
|
|
151
|
+
ctx.log.info('Terminal space fetched', {
|
|
152
|
+
total: all.length,
|
|
153
|
+
totalCount,
|
|
154
|
+
offset,
|
|
155
|
+
limit,
|
|
156
|
+
returned: terminals.length,
|
|
157
|
+
});
|
|
113
158
|
ctx.enrich({
|
|
114
|
-
totalCount
|
|
159
|
+
totalCount,
|
|
160
|
+
nextOffset,
|
|
161
|
+
hasMore,
|
|
115
162
|
...(input.departingTerminalId != null && { terminalFilter: input.departingTerminalId }),
|
|
116
163
|
});
|
|
117
|
-
if (
|
|
164
|
+
if (totalCount === 0) {
|
|
118
165
|
ctx.enrich.notice(input.departingTerminalId != null
|
|
119
166
|
? `No terminal space data found for terminal ID ${input.departingTerminalId}. Use wsdot_get_ferry_terminals to verify valid terminal IDs.`
|
|
120
167
|
: 'No terminal space data available. The WSF API may be temporarily unavailable — retry in 30 seconds.');
|
|
121
168
|
}
|
|
122
|
-
|
|
169
|
+
else if (terminals.length === 0) {
|
|
170
|
+
ctx.enrich.notice(`Offset ${offset} is past the end of ${totalCount} matching terminals. Use an offset between 0 and ${totalCount - 1}.`);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const window = `Showing terminals ${offset + 1}–${offset + terminals.length} of ${totalCount}, each with all of its upcoming sailings.`;
|
|
174
|
+
ctx.enrich.notice(hasMore ? `${window} Pass offset=${nextOffset} for the next page.` : window);
|
|
175
|
+
}
|
|
176
|
+
return { terminals };
|
|
123
177
|
},
|
|
124
178
|
format: (result) => {
|
|
125
179
|
if (result.terminals.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-terminal-space.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-terminal-space.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,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAC/D,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,4GAA4G;QAC5G,iFAAiF;QACjF,6FAA6F;QAC7F,6EAA6E;QAC7E,2FAA2F;QAC3F,
|
|
1
|
+
{"version":3,"file":"get-terminal-space.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-terminal-space.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAA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AAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC1D,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,UAAU,IAAI,EAAE,CAAC,CAAC;oBACtE,CAAC;oBACD,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;wBAC3B,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC;oBACnE,CAAC;gBACH,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"}
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
export declare const getTollRates: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
export declare const getTollRates: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
11
|
rates: z.ZodArray<z.ZodObject<{
|
|
9
12
|
tripName: z.ZodOptional<z.ZodString>;
|
|
10
13
|
stateRoute: z.ZodOptional<z.ZodString>;
|
|
@@ -35,6 +38,8 @@ export declare const getTollRates: import("@cyanheads/mcp-ts-core").ToolDefiniti
|
|
|
35
38
|
readonly recovery: "Register an access code at https://wsdot.wa.gov/traffic/api/, set WSDOT_ACCESS_CODE on the server, and restart it.";
|
|
36
39
|
}], {
|
|
37
40
|
readonly totalCount: z.ZodNumber;
|
|
41
|
+
readonly nextOffset: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
readonly hasMore: z.ZodBoolean;
|
|
38
43
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
39
44
|
}>;
|
|
40
45
|
//# sourceMappingURL=get-toll-rates.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-toll-rates.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-toll-rates.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+JvB,CAAC"}
|
|
@@ -5,13 +5,30 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { getTrafficApiService } from '../../../services/traffic/traffic-service.js';
|
|
8
|
+
const DEFAULT_LIMIT = 50;
|
|
9
|
+
const MAX_LIMIT = 500;
|
|
8
10
|
export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
9
11
|
title: 'Get Toll Rates',
|
|
10
12
|
description: 'Returns current dynamic toll rates for WA express lanes and tolled facilities: SR 99 (WSDOT Tunnel), ' +
|
|
11
13
|
'SR 520 Bridge, I-405 Express Lanes, I-90 Two-Way Express Lanes, and SR 167 HOT Lanes. ' +
|
|
12
|
-
'Rates are time-banded and change dynamically based on traffic conditions.'
|
|
14
|
+
'Rates are time-banded and change dynamically based on traffic conditions. ' +
|
|
15
|
+
'Results are paged — pass offset/limit to page through the full set (the notice reports the next offset).',
|
|
13
16
|
annotations: { readOnlyHint: true },
|
|
14
|
-
input: z.object({
|
|
17
|
+
input: z.object({
|
|
18
|
+
offset: z
|
|
19
|
+
.number()
|
|
20
|
+
.int()
|
|
21
|
+
.min(0)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Zero-based index of the first toll rate to return, for paging. Defaults to 0.'),
|
|
24
|
+
limit: z
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.min(1)
|
|
28
|
+
.max(MAX_LIMIT)
|
|
29
|
+
.optional()
|
|
30
|
+
.describe(`Maximum toll rates to return in this page (1–${MAX_LIMIT}). Defaults to ${DEFAULT_LIMIT}.`),
|
|
31
|
+
}),
|
|
15
32
|
output: z.object({
|
|
16
33
|
rates: z
|
|
17
34
|
.array(z
|
|
@@ -44,11 +61,18 @@ export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
|
44
61
|
.describe('Current toll rates for all active tolled facilities.'),
|
|
45
62
|
}),
|
|
46
63
|
enrichment: {
|
|
47
|
-
totalCount: z
|
|
64
|
+
totalCount: z
|
|
65
|
+
.number()
|
|
66
|
+
.describe('Total toll rate entries across all pages (not just this page).'),
|
|
67
|
+
nextOffset: z
|
|
68
|
+
.number()
|
|
69
|
+
.nullable()
|
|
70
|
+
.describe('Offset to pass to retrieve the next page, or null when this is the last page.'),
|
|
71
|
+
hasMore: z.boolean().describe('True when more toll rates remain beyond the current page.'),
|
|
48
72
|
notice: z
|
|
49
73
|
.string()
|
|
50
74
|
.optional()
|
|
51
|
-
.describe('
|
|
75
|
+
.describe('Informational note about the page window, or guidance when no toll rate data is available or the offset ran past the end.'),
|
|
52
76
|
},
|
|
53
77
|
errors: [
|
|
54
78
|
{
|
|
@@ -66,13 +90,29 @@ export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
|
66
90
|
recovery: 'Register an access code at https://wsdot.wa.gov/traffic/api/, set WSDOT_ACCESS_CODE on the server, and restart it.',
|
|
67
91
|
},
|
|
68
92
|
],
|
|
69
|
-
async handler(
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
93
|
+
async handler(input, ctx) {
|
|
94
|
+
const allRates = await getTrafficApiService().getTollRates(ctx);
|
|
95
|
+
// Page the full set so structuredContent and content[] carry the identical page (the
|
|
96
|
+
// service stays filter-only; paging is a tool-handler concern). totalCount stays the
|
|
97
|
+
// full entry count so the agent knows how much lies beyond this page.
|
|
98
|
+
const totalCount = allRates.length;
|
|
99
|
+
const offset = input.offset ?? 0;
|
|
100
|
+
const limit = input.limit ?? DEFAULT_LIMIT;
|
|
101
|
+
const rates = allRates.slice(offset, offset + limit);
|
|
102
|
+
const hasMore = offset + rates.length < totalCount;
|
|
103
|
+
const nextOffset = hasMore ? offset + rates.length : null;
|
|
104
|
+
ctx.log.info('Toll rates fetched', { totalCount, offset, limit, returned: rates.length });
|
|
105
|
+
ctx.enrich({ totalCount, nextOffset, hasMore });
|
|
106
|
+
if (totalCount === 0) {
|
|
74
107
|
ctx.enrich.notice('No toll rate data available. The WSDOT API may be temporarily unavailable — retry in 30 seconds.');
|
|
75
108
|
}
|
|
109
|
+
else if (rates.length === 0) {
|
|
110
|
+
ctx.enrich.notice(`Offset ${offset} is past the end of ${totalCount} toll rate entries. Use an offset between 0 and ${totalCount - 1}.`);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const window = `Showing toll rates ${offset + 1}–${offset + rates.length} of ${totalCount}.`;
|
|
114
|
+
ctx.enrich.notice(hasMore ? `${window} Pass offset=${nextOffset} for the next page.` : window);
|
|
115
|
+
}
|
|
76
116
|
return { rates };
|
|
77
117
|
},
|
|
78
118
|
format: (result) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-toll-rates.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.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,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,EAAE;IACvD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,uGAAuG;QACvG,wFAAwF;QACxF,
|
|
1
|
+
{"version":3,"file":"get-toll-rates.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.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,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,EAAE;IACvD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,uGAAuG;QACvG,wFAAwF;QACxF,4EAA4E;QAC5E,0GAA0G;IAC5G,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,+EAA+E,CAAC;QAC5F,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC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AAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;YACtE,IAAI,CAAC,CAAC,iBAAiB,IAAI,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC5F,IAAI,CAAC,CAAC,OAAO;gBAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,CAAC,aAAa,IAAI,IAAI,IAAI,CAAC,CAAC,cAAc,IAAI,IAAI;gBACrD,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;YAC1E,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,IAAI,CAAC,CAAC,YAAY,IAAI,IAAI;gBACjD,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;YACpE,IAAI,CAAC,CAAC,WAAW;gBAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;YAC/D,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"}
|
|
@@ -6,6 +6,8 @@ import { z } from '@cyanheads/mcp-ts-core';
|
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
export declare const getTravelTimes: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
8
|
route: z.ZodOptional<z.ZodString>;
|
|
9
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
9
11
|
}, z.core.$strip>, z.ZodObject<{
|
|
10
12
|
corridors: z.ZodArray<z.ZodObject<{
|
|
11
13
|
travelTimeId: z.ZodOptional<z.ZodNumber>;
|
|
@@ -41,6 +43,8 @@ export declare const getTravelTimes: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
41
43
|
readonly recovery: "Register an access code at https://wsdot.wa.gov/traffic/api/, set WSDOT_ACCESS_CODE on the server, and restart it.";
|
|
42
44
|
}], {
|
|
43
45
|
readonly totalCount: z.ZodNumber;
|
|
46
|
+
readonly nextOffset: z.ZodNullable<z.ZodNumber>;
|
|
47
|
+
readonly hasMore: z.ZodBoolean;
|
|
44
48
|
readonly routeFilter: z.ZodOptional<z.ZodString>;
|
|
45
49
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
46
50
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-travel-times.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-travel-times.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-travel-times.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-travel-times.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuPzB,CAAC"}
|