@motorbay/mcp 0.1.3 → 0.1.4
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/tools.js +10 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/tools.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
const id = (what) => z.string().regex(/^\d{1,19}$/, "A Motorbay id is a string of digits").describe(what);
|
|
3
|
+
// What may go into the path for a plate or a VIN, as in the monday Worker,
|
|
4
|
+
// the apps and the SDKs (#76, #81): letters (Æ, Ø, Å too), digits, spaces
|
|
5
|
+
// and hyphens, 1 to 17 characters once trimmed. encodeURIComponent leaves
|
|
6
|
+
// `.` alone and fetch resolves a `..` segment, so `..` would otherwise send
|
|
7
|
+
// GET /v1/vehicles/ (Search vehicles, no filter).
|
|
8
|
+
const plateOrVin = (what) => z.string().trim()
|
|
9
|
+
.regex(/^[A-Za-z0-9ÆØÅæøå -]{1,17}$/, "A plate or a VIN is letters, digits, spaces and hyphens, 1 to 17 characters")
|
|
10
|
+
.describe(what);
|
|
3
11
|
const vehicleId = id("The vehicle's Motorbay id (the `id` field from a vehicle lookup), e.g. \"1000123456\".");
|
|
4
12
|
const page = z.number().int().min(1).optional().describe("Page number, from 1. Default 1.");
|
|
5
13
|
const pageSize = z.number().int().min(1).max(50).optional().describe("Items per page, 1 to 50. Default 10.");
|
|
@@ -10,14 +18,14 @@ export const TOOLS = [
|
|
|
10
18
|
title: "Vehicle by plate",
|
|
11
19
|
path: "/v1/vehicles/plate/{plate}",
|
|
12
20
|
description: `Look up a Danish vehicle by registration number (plate), e.g. "AB12345". Case, spaces and hyphens are ignored. Returns make, model, variant, VIN, kind, color, first registration date, registration status and the vehicle's id, which the other vehicle tools take. Plates are reused: this returns the vehicle currently registered with the plate; use search_vehicles with registrationNumber for every vehicle that has carried it. ${SOURCE}`,
|
|
13
|
-
input: { plate:
|
|
21
|
+
input: { plate: plateOrVin("Danish registration number, e.g. \"AB12345\" or \"ab 12 345\".") },
|
|
14
22
|
},
|
|
15
23
|
{
|
|
16
24
|
name: "get_vehicle_by_vin",
|
|
17
25
|
title: "Vehicle by VIN",
|
|
18
26
|
path: "/v1/vehicles/vin/{vin}",
|
|
19
27
|
description: `Look up a vehicle in the Danish register by VIN (chassis/frame number). Returns the same fields as get_vehicle_by_plate, including the id used by the other vehicle tools. ${SOURCE}`,
|
|
20
|
-
input: { vin:
|
|
28
|
+
input: { vin: plateOrVin("Vehicle identification number, e.g. \"WVWZZZAUZKW123456\".") },
|
|
21
29
|
},
|
|
22
30
|
{
|
|
23
31
|
name: "get_vehicle",
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.1.
|
|
1
|
+
export const VERSION = "0.1.4";
|