get_traffic_count
Retrieve traffic volume data from ASTRA counting stations in Switzerland. Provides daily and weekday counts, heavy vehicle percentages, and measurement year for specific locations.
Instructions
Get traffic volume at an ASTRA counting station in Switzerland by location name (e.g. 'Gotthard', 'Zürich', 'Genf'). Returns daily and weekday traffic counts, heavy vehicle percentage, and measurement year.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | Station or location name to search (e.g. 'Gotthard', 'Zürich', 'Basel') |
Implementation Reference
- src/modules/traffic.ts:146-162 (handler)The switch case handler implementation for the get_traffic_count tool.
case "get_traffic_count": { const location = args.location as string; const url = buildUrl(`${GEO_ADMIN}/find`, { layer: TRAFFIC_LAYER, searchText: location, searchField: "mlocname", returnGeometry: false, }); const data = await fetchJSON<FindResponse>(url); const stations = data.results.map(slimTrafficStation); return JSON.stringify({ count: stations.length, query: location, stations, source: "ASTRA — Federal Roads Office (Bundesamt für Strassen)", }); } - src/modules/traffic.ts:87-101 (schema)The tool definition including the inputSchema for get_traffic_count.
{ name: "get_traffic_count", description: "Get traffic volume at an ASTRA counting station in Switzerland by location name (e.g. 'Gotthard', 'Zürich', 'Genf'). Returns daily and weekday traffic counts, heavy vehicle percentage, and measurement year.", inputSchema: { type: "object", required: ["location"], properties: { location: { type: "string", description: "Station or location name to search (e.g. 'Gotthard', 'Zürich', 'Basel')", }, }, }, },