nbrain-mena-logistics-wasl-dispatch
# `nbrain-mena-logistics-wasl-dispatch` — Saudi `TGA Wasl` Telematics, UK `TfL PHV` Private Hire Compliance, `WGS84 Vincenty` Geodesy & Last-Mile `COD` Ledger + MCP Server
[](./LICENSE)
[](./pyproject.toml)
[](./server.json)
Engineered by **[Eng. Nadeem Mohamed Badr El-Din](https://nadeembadr.com)** at **[NBrain (`منظومة إن برين` — nbra.in)](https://nbra.in)** for commercial fleet telematics, cold-chain pharmaceutical delivery, UK private-hire dispatch, and MENA e-commerce COD couriers.
## Core Modules
1. **Saudi Transport General Authority (`TGA Wasl` — وصل)**: Validates 15-digit GPS tracker `IMEI` Luhn check digits, KSA spatial bounds, commercial speed caps, and **SFDA Cold-Chain cargo temperature regimes** (`2°C–8°C` chilled pharma, `<= -18°C` frozen, `15°C–25°C` controlled ambient).
2. **Iterative `WGS84 Vincenty` Ellipsoidal Distance (`0.5 mm` precision)**: Sub-millimeter oblate-spheroid geodesic distance + exact-`Decimal` dispatch fare and surge pricing.
3. **UK `TfL Private Hire (PHV)` Operator Compliance**: Enforces the post-2021 High Court **Operator-as-Principal** contract & 20% UK VAT rule, pre-booked dispatch timestamps (blocking illegal plying-for-hire), and driver/vehicle/operator badge validity.
4. **Last-Mile `COD` (Cash-on-Delivery) Manifest Reconciler**: Exact `Decimal` courier cash-in-hand variance, `RTO` (Return-to-Origin) fee handling, and merchant net settlement.
## Quick Verification
```bash
PYTHONPATH=src python -m unittest discover -s tests -v
```
TDQS
Scored across 4 tools
Each tool targets a distinct jurisdiction and artifact: Saudi TGA Wasl telemetry validation, WGS84/Vincenty fare computation, UK TfL PHV booking audit, and COD/RTO manifest reconciliation. Despite all being logistics-compliance operations, the region and object qualifiers make misselection unlikely.
All four names are snake_case and verb-first (validate_, calculate_, audit_, reconcile_), which is a predictable pattern. The names are extremely long and heavily over-qualified, but the convention itself is consistent.
Four tools is on the thin side but each covers a genuinely separate compliance/calculation concern, so none feels redundant. For a narrow regulatory-dispatch utility, this is a reasonable scoping.
The surface is entirely stateless validators/calculators with no create/get/update operations for bookings, shipments, or drivers, so agents hit dead ends for lifecycle work like creating a dispatch or tracking status. Core regulatory checks are covered, but the dispatch domain itself is only partially represented.