TomTom Traffic Analytics MCP

Junction Analytics Tools

Junction Analytics Tools

Monitor traffic flow at intersections with real-time and historical data. These tools let you search your junction inventory, check live congestion metrics, and download historical archives for trend analysis.

Recommended workflow: Use tomtom-junction-search first to discover junction IDs, then pass them to tomtom-junction-live-data or tomtom-junction-archive for traffic analysis.


Search and filter all junctions by name, status, country, or other properties.

Parameters

ParameterTypeRequiredDescription
viewenumNocompact (default) or full. Compact returns the junctions table only. Full adds approaches and exits tables
sql_queriesobjectYesNamed SQL queries

SQL Tables

junctions: Always available

ColumnTypeDescription
junction_idstringUnique junction identifier
namestringJunction name
statusstringACTIVE, PENDING_UPDATE, or ERROR
country_codestringISO 3166-1 alpha-3 code (e.g., ESP, DEU, USA, GBR)
drive_on_leftnumber0 or 1
traffic_lightsnumber0 or 1
num_approachesnumberNumber of approaches
num_exitsnumberNumber of exits
created_atstringCreation timestamp
last_modified_atstringLast modification timestamp
time_zonestringTimezone identifier

approaches: Full view only

ColumnTypeDescription
junction_idstringReference to junction
approach_idnumberApproach identifier
namestringApproach name
road_namestringRoad name
directionstringNORTH, SOUTH, EAST, WEST
frcnumberFunctional road class (0–7)
lengthnumberLength in meters
one_way_roadnumber0 or 1
excludednumber0 or 1
drivablenumber0 or 1

exits: Full view only

ColumnTypeDescription
junction_idstringReference to junction
exit_idnumberExit identifier
namestringExit name
road_namestringRoad name
directionstringNORTH, SOUTH, EAST, WEST
frcnumberFunctional road class (0–7)
one_way_roadnumber0 or 1
drivablenumber0 or 1

Example SQL Queries

-- Find junctions by name
SELECT junction_id, name, country_code FROM junctions WHERE name ILIKE '%highway%'
-- Count junctions by country
SELECT country_code, COUNT(*) as count FROM junctions GROUP BY country_code ORDER BY count DESC
-- Find junctions by road name (full view)
SELECT j.junction_id, j.name, a.road_name
FROM junctions j
JOIN approaches a ON j.junction_id = a.junction_id
WHERE a.road_name ILIKE '%Main%'

tomtom-junction-live-data

Access real-time traffic metrics for junctions, including delays, queue lengths, stops, turn ratios, and volume. Supports up to 20 junctions per request for cross-junction comparisons.

Parameters

ParameterTypeRequiredDescription
junctionIdsstring[]YesJunction IDs to query (1–20). Data is merged for cross-junction SQL
includeGeometrybooleanNoSet true to populate metadata tables with junction geometry
sql_queriesobjectYesNamed SQL queries

SQL Tables

approaches: Real-time metrics per approach

ColumnTypeDescription
junction_idstringJunction ID
approach_idnumberApproach identifier
travel_time_secnumberTravel time in seconds
free_flow_travel_time_secnumberFree flow travel time
delay_secnumberDelay in seconds
usual_delay_secnumberUsual delay in seconds
stopsnumberNumber of stops
queue_length_metersnumberQueue length
volume_per_hournumberTraffic volume per hour
is_closednumber0 or 1

turn_ratios: Turn distribution at junction

ColumnTypeDescription
junction_idstringJunction ID
approach_idnumberApproach identifier
exit_idnumberExit identifier
exit_indexnumberExit index
ratio_percentnumberTurn ratio as percentage
probes_countnumberNumber of probe samples

stops_histogram: Distribution of stop counts

ColumnTypeDescription
junction_idstringJunction ID
approach_idnumberApproach identifier
number_of_stopsnumberStop count bucket
number_of_vehiclesnumberVehicle count in bucket

junction_metadata, approach_metadata, exit_metadata: Available when includeGeometry is true. Contains the same columns as the junction search tables plus geometry data.

Example SQL Queries

-- Most delayed approaches
SELECT junction_id, approach_id, delay_sec, queue_length_meters
FROM approaches
ORDER BY delay_sec DESC
LIMIT 5
-- Turn ratios for a specific approach
SELECT exit_id, ratio_percent
FROM turn_ratios
WHERE approach_id = 1
ORDER BY ratio_percent DESC
-- Compare junctions by average delay
SELECT junction_id, ROUND(AVG(delay_sec), 2) as avg_delay
FROM approaches
GROUP BY junction_id
ORDER BY avg_delay DESC

tomtom-junction-archive

Download minute-by-minute historical traffic data for junctions over a date range (maximum 2 days). Supports up to 20 junctions per request.

Parameters

ParameterTypeRequiredDescription
junctionIdsstring[]YesJunction IDs to query (1–20). Data is merged for cross-junction SQL
fromstringYesStart date (YYYY-MM-DD)
tostringNoEnd date (YYYY-MM-DD). Maximum 2-day range from start
sql_queriesobjectYesNamed SQL queries

SQL Tables

approaches: Historical approach metrics with timestamps

ColumnTypeDescription
timestringISO timestamp
junction_idstringJunction ID
approach_idstringApproach identifier
travel_time_secnumberTravel time in seconds
free_flow_travel_time_secnumberFree flow travel time
delay_secnumberDelay in seconds
usual_delay_secnumberUsual delay in seconds
stopsnumberNumber of stops
queue_length_metersnumberQueue length
volume_per_hournumberTraffic volume per hour
is_closednumber0 or 1

turn_ratios: Historical turn ratios with timestamps

ColumnTypeDescription
timestringISO timestamp
junction_idstringJunction ID
approach_idstringApproach identifier
exit_idstringExit identifier
exit_indexnumberExit index
ratio_percentnumberTurn ratio as percentage
probes_countnumberProbe sample count

Example SQL Queries

-- Hourly average delays
SELECT date_part('hour', time::TIMESTAMP) as hour,
ROUND(AVG(delay_sec), 2) as avg_delay,
MAX(delay_sec) as max_delay
FROM approaches
GROUP BY hour
ORDER BY hour
-- Peak congestion periods
SELECT time::DATE as day,
date_part('hour', time::TIMESTAMP) as hour,
ROUND(AVG(delay_sec), 2) as avg_delay
FROM approaches
WHERE delay_sec > 30
GROUP BY day, hour
ORDER BY avg_delay DESC
LIMIT 10