Storage — fmcsa_snapshots Table
Every successful FMCSA fetch for a carrier produces a row in fmcsa_snapshots. Rows are never updated or deleted — the table is a pure time series.
Note:snapshot_dateis set to the cron run date (UTC), notfetched_at. This makes it safe to backfill or re-run a cron for a given date without creating duplicate trend data — inserts useINSERT IGNOREkeyed on(carrier_id, snapshot_date, endpoint).
Three Endpoints Per Carrier
Each daily run calls three FMCSA QCMobile API endpoints for every carrier:| Endpoint | Data Captured |
|---|---|
GET /carriers/:dot | Legal name, DBA, authority status, insurance on file, physical address |
GET /carriers/:dot/basics | CSA BASIC percentile scores (7 BASICs), investigation history |
GET /carriers/:dot/oos | Out-of-service rates (vehicle, driver, hazmat) vs. national averages |
History API Routes
Snapshot History
Returns paginated snapshots for a single carrier, newest first.| Parameter | Type | Description |
|---|---|---|
carrierId | string | Required. The internal carrier ID. |
dotNumber | string | Alternative to carrierId — look up by DOT number. |
endpoint | string | Filter to one endpoint: carriers, basics, or oos. |
from | date | Start of date range (ISO 8601, inclusive). |
to | date | End of date range (ISO 8601, inclusive). |
limit | number | Page size (default 30, max 90). |
cursor | string | Pagination cursor from previous response. |
Trend Data
Aggregates key metrics across snapshots into a time series suitable for charting.metric options:
| Metric | Source Endpoint | Description |
|---|---|---|
oos_vehicle | oos | Vehicle out-of-service rate (%) |
oos_driver | oos | Driver out-of-service rate (%) |
oos_hazmat | oos | Hazmat out-of-service rate (%) |
basic_hos | basics | HOS Compliance BASIC percentile |
basic_unsafe | basics | Unsafe Driving BASIC percentile |
basic_driver | basics | Driver Fitness BASIC percentile |
basic_vehicle | basics | Vehicle Maintenance BASIC percentile |
Data Stats
Returns coverage statistics — how many carriers have snapshots, how far back data goes, and whether any carriers are missing recent snapshots.staleCarriers lists carriers whose most recent snapshot is more than 2 days old — indicating a fetch failure that should be investigated.
MCP Tool Integration
The MCP server exposes three tools that give AI agents direct access to FMCSA snapshot data. These are used by the underwriting AI assistant to answer questions about carrier safety history without requiring the underwriter to navigate to the workbench.get_fmcsa_snapshot
Returns the most recent (or a specific date’s) snapshot for a carrier.
get_fmcsa_trend
Returns a time series of a single metric for use in AI analysis or narrative generation.
get_fmcsa_data_stats
Returns coverage stats for a given organization. Useful for compliance review agents checking data completeness.
Note:
MCP tool calls are authenticated using the system service account JWT and are scoped to the
requesting organization’s carriers. Cross-org access requires superadmin elevation.