Tabussen Trip Planner
Plan public transport journeys in Västerbotten, Sweden - including Umeå local traffic (Ultra) and regional routes (Länstrafiken Västerbotten).
Overview
This skill uses the ResRobot API (Trafiklab) to provide journey planning for Tabussen/Ultra. ResRobot is Sweden's national public transport API covering all operators including Länstrafiken Västerbotten.
Coverage:
- - Ultra (Umeå local bus traffic)
- Länstrafiken Västerbotten (regional buses)
- Connections to/from other Swedish regions
- Train connections where applicable
Commands
1. Search Location
Search for stops, stations, or points of interest.
CODEBLOCK0
| Argument | Description |
|---|
| INLINECODE0 | Location name to search for (append ? for fuzzy search) |
| INLINECODE2 |
Number of results to show (default: 5, max: 10) |
Output includes:
- -
ID - The stop identifier (use this in journey search) - INLINECODE4 - Official name of the stop
- INLINECODE5 - Latitude, longitude
- INLINECODE6 - Traffic volume indicator (higher = more traffic)
Search tips:
- - Use
? suffix for fuzzy/partial matching: INLINECODE8 - Exact search without
?: INLINECODE10 - Include municipality for precision: INLINECODE11
2. Journey Search
Plan a journey between two locations using their IDs.
CODEBLOCK1
| Argument | Description |
|---|
| INLINECODE12 | Origin stop ID (from search) |
| INLINECODE13 |
Destination stop ID |
|
datetime | Optional:
"18:30",
"tomorrow 09:00",
"2026-01-28 14:00" |
|
mode | Optional:
"depart" (default) or
"arrive" |
Coordinate-based search:
./journey.sh "63.825#20.263" <to-id> [datetime] [mode]
Use
lat#lon format for coordinates (WGS84 decimal degrees).
Understanding User Time Intent
Before searching, understand what the user wants:
Intent Types
| User Says | Intent | How to Query |
|---|
| "now", "next bus", "how do I get to" | Travel Now | No datetime parameter |
| "in 30 minutes", "in 1 hour" |
Depart Later | Calculate time, use
depart mode |
| "around 15:00", "sometime afternoon" |
Around Time | Query with offset (see below) |
| "arrive by 18:00", "need to be there at 9" |
Arrive By | Use
arrive mode |
| "tomorrow morning", "on Friday at 10" |
Future Time | Use specific datetime |
Handling "Around Time" Queries
When user wants options "around" a time, query 15-30 minutes earlier to show options before and after:
CODEBLOCK3
Relative Time Calculations
Convert relative times to absolute:
| User Says | Current: 14:00 | Query Time |
|---|
| "in 30m" | -> | "14:30" |
| "in 1h" |
-> | "15:00" |
| "in 2 hours" | -> | "16:00" |
LLM Response Formatting
When presenting journey results to users, use these emojis and formatting guidelines.
Emoji Reference
| Emoji | Use For |
|---|
| INLINECODE24 | Bus (Tabussen/Ultra) |
| INLINECODE25 |
Train |
|
walk | Walking segment |
|
clock | Time/duration |
|
clock1 | Departure time |
|
goal | Arrival time |
|
pin | Stop/station |
|
house | Origin (home/start) |
|
target | Destination |
|
warning | Delay or disruption |
|
check | On time |
|
arrows_counterclockwise | Transfer/change |
Response Structure
Always include these key elements from the tool output:
- 1. When to leave - The actual time user needs to start (including walking)
- Walking segments - Distance and time for any walking
- Transport departure - When the bus actually leaves
- Arrival time - When user reaches destination
- Line number and direction - Which bus to take
Example Response Format
For a simple direct journey:
CODEBLOCK4
For a journey with transfer:
CODEBLOCK5
Walking Segment Details
Always show walking details:
- - Distance in meters
- Include walking in the "leave time" calculation
- Walk time estimate: ~100m per minute (normal walking speed)
Presenting Multiple Options
When showing journey options, make timing crystal clear:
CODEBLOCK6
LLM Workflow: How to Plan a Trip
Follow this workflow when a user asks for a trip:
Step 1: Understand Time Intent
Parse what the user wants:
- - "How do I get to..." -> Travel now
- "I need to be there at 18:00" -> Arrive mode
- "Sometime around 3pm" -> Query 14:30, show range
- "In about an hour" -> Calculate from current time
Step 2: Search for Both Locations
Search for origin and destination separately:
CODEBLOCK7
Step 3: Validate Search Results
Check each result carefully:
- 1. Exact or close match? - If the name matches what the user asked for, proceed.
- 2. Multiple results returned? - The script shows up to 10 matches. If the first result isn't clearly correct, ask the user to confirm.
- 3. Name significantly different? - If user asked for "university" and result shows "Umeå Universitet", confirm with user.
- 4. No results found? - Try alternative strategies (see below).
Step 4: Handle Ambiguous or Failed Searches
When results don't match or are ambiguous, ask clarifying questions:
CODEBLOCK8
When no results are found, try these strategies:
- 1. Try with city name:
CODEBLOCK9
- 2. Try common variations:
CODEBLOCK10
- 3. Use fuzzy search (add ?):
CODEBLOCK11
Step 5: Execute Journey Search
Once you have confirmed IDs for both locations:
CODEBLOCK12
Step 6: Format Response
Use the formatting guide above to present results clearly. Always use actual numbers from the tool output - never estimate or speculate.
Query Formatting Rules
The search API is sensitive to formatting. Follow these rules:
Common Stop Names in Umeå
| User Says | Search For |
|---|
| "Vasaplan", "centrum" | INLINECODE36 |
| "Universitetet", "uni" |
"Umeå universitet?" |
| "NUS", "sjukhuset" |
"Norrlands universitetssjukhus?" |
| "Ikea" |
"IKEA Umeå?" |
| "Flygplatsen" |
"Umeå Airport?" |
| "Järnvägsstationen", "tåget" |
"Umeå centralstation?" |
Regional Destinations
| Destination | Search For |
|---|
| Skellefteå | INLINECODE42 |
| Lycksele |
"Lycksele busstation?" |
| Vindeln |
"Vindeln station?" |
| Robertsfors |
"Robertsfors centrum?" |
| Holmsund |
"Holmsund centrum?" |
Street Addresses
Include city name for better accuracy:
./search-location.sh "Storgatan 25, Umeå?"
./search-location.sh "Kungsgatan 10, Skellefteå?"
Examples
Example 1: Travel Now (Umeå Local)
User: "How do I get from Vasaplan to NUS?"
CODEBLOCK14
Response:
CODEBLOCK15
Example 2: Regional Journey
User: "I need to get to Skellefteå from Umeå tomorrow at 8"
CODEBLOCK16
Response:
CODEBLOCK17
Example 3: Arrive By Time
User: "I need to be at NUS by 08:00 tomorrow"
CODEBLOCK18
Response:
CODEBLOCK19
Example 4: From Address/Coordinates
User: "I'm at Storgatan 50 in Umeå, how do I get to IKEA?"
CODEBLOCK20
DateTime Formats
All times are Swedish local time (CET/CEST).
| Format | Example | Meaning |
|---|
| (empty) | | Travel now |
| INLINECODE47 |
"08:30" | Today at 08:30 |
|
tomorrow HH:MM |
"tomorrow 09:00" | Tomorrow at 09:00 |
|
YYYY-MM-DD HH:MM |
"2026-01-28 14:00" | Specific date |
Output Format
Journey Option (Raw Tool Output)
CODEBLOCK21
Transport Types
| Type | Description |
|---|
| INLINECODE53 | Tabussen/Ultra/Länstrafik bus |
| INLINECODE54 |
Regional bus (Länstrafik) |
|
JRE | Regional train |
|
WALK | Walking segment |
Operators in Västerbotten
| Operator | Description |
|---|
| Länstrafiken Västerbotten | Regional and local buses |
| Ultra |
Umeå local traffic (part of Länstrafiken) |
| SJ | Long-distance trains |
| Norrtåg | Regional trains |
Error Handling
"No locations found"
The search returned no results.
Strategies:
- 1. Check spelling (Swedish: å, ä, ö)
- Try with city name suffix
- Use fuzzy search (add ?)
- Try common alternative names
- Ask user for clarification
"No journeys found"
No routes available.
Strategies:
- 1. Check if service operates at that hour (late night limited)
- Try different departure time
- Suggest alternative nearby stops
- Note that some regional routes have limited frequency
Common Issues
| Issue | Solution |
|---|
| "Vasaplan" returns multiple | Use "Umeå Vasaplan" |
| Stop not found |
Try fuzzy search with ? |
| No late-night routes | Ultra has limited night service |
| Long wait times | Regional routes may be hourly |
Quick Reference
Popular Umeå Stops (Ultra)
| Stop | ID | Notes |
|---|
| Vasaplan | 740020116 | Central hub |
| Universitetssjukhuset (NUS) |
740023840 | Hospital |
| Universum | 740026881 | University area |
| Umeå Busstation | - | Regional bus departures |
| Västerslätt Centrum | 740045407 | Western suburb |
Key Regional Stops
| Stop | ID | Notes |
|---|
| Skellefteå busstation | 740000053 | Regional hub |
| Lycksele busstation |
- | Inland hub |
| Vindeln station | - | Train connection |
| Robertsfors centrum | - | Coastal route |
API Details (For Script Development)
This skill uses ResRobot API v2.1 from Trafiklab.
Base URL: INLINECODE57
Endpoints:
- - Stop lookup: INLINECODE58
- Journey planner: INLINECODE59
Key Parameters:
- -
accessId - API key (required) - INLINECODE61 - json or xml
- INLINECODE62 /
destId - Stop IDs - INLINECODE64 /
time - Travel date/time - INLINECODE66 - 1 for arrive-by searches
Get API Key: Register at https://developer.trafiklab.se
Notes on Västerbotten Traffic
Ultra (Umeå Local)
- - Frequent service in central Umeå
- Lines 1-9 are most common
- Night buses (N-lines) on weekends
- Real-time info available in app
Länstrafiken (Regional)
- - Line 100: Umeå - Skellefteå (frequent)
- Line 12/20: Coastal routes
- Lines 30-49: Inland routes
- Frequency varies by route
Tips for Users
- - Vasaplan is the main hub for both Ultra and regional
- Many regional buses depart from Vasaplan, not train station
- Train station (Umeå C) is separate from bus station
- IKEA and Avion have good bus connections
When to Ask Clarifying Questions
Always ask when:
- 1. Search returns no results:
- "I couldn't find [location]. Could you provide more details?"
- 2. Multiple plausible matches:
- "I found several stops matching '[query]': [list]. Which one?"
- 3. Result name very different from query:
- "You asked for '[user query]' but I found '[result name]'. Is this correct?"
- 4. User request is vague:
- "From where in Umeå? Vasaplan (central), or another location?"
- 5. Time is unclear:
- "When do you want to travel? Now, or at a specific time?"
Tabussen 行程规划器
规划瑞典西博滕省的公共交通行程——包括于默奥本地交通(Ultra)和区域线路(Länstrafiken Västerbotten)。
概述
本技能使用 ResRobot API(Trafiklab)为 Tabussen/Ultra 提供行程规划服务。ResRobot 是瑞典全国公共交通 API,覆盖所有运营商,包括 Länstrafiken Västerbotten。
覆盖范围:
- - Ultra(于默奥本地公交)
- Länstrafiken Västerbotten(区域公交)
- 往返瑞典其他地区的连接
- 适用的火车连接
命令
1. 搜索地点
搜索站点、车站或兴趣点。
bash
./search-location.sh <查询词> [数量限制]
| 参数 | 说明 |
|---|
| 查询词 | 要搜索的地点名称(追加 ? 进行模糊搜索) |
| 数量限制 |
显示的结果数量(默认:5,最大:10) |
输出包含:
- - ID - 站点标识符(在行程搜索中使用)
- 名称 - 站点的官方名称
- 坐标 - 纬度,经度
- 权重 - 交通流量指标(越高表示交通量越大)
搜索提示:
- - 使用 ? 后缀进行模糊/部分匹配:Vasaplan?
- 不带 ? 的精确搜索:Vasaplan
- 包含市镇以提高精确度:Umeå Vasaplan
2. 行程搜索
使用站点 ID 规划两个地点之间的行程。
bash
./journey.sh <起点ID> <终点ID> [日期时间] [模式]
终点站 ID |
| 日期时间 | 可选:18:30、tomorrow 09:00、2026-01-28 14:00 |
| 模式 | 可选:depart(默认)或 arrive |
基于坐标的搜索:
bash
./journey.sh 63.825#20.263 <终点ID> [日期时间] [模式]
使用 lat#lon 格式表示坐标(WGS84 十进制度数)。
理解用户时间意图
在搜索之前,了解用户的需求:
意图类型
| 用户说 | 意图 | 如何查询 |
|---|
| 现在、下一班车、我怎么去 | 立即出发 | 不传日期时间参数 |
| 30分钟后、1小时后 |
稍后出发 | 计算时间,使用 depart 模式 |
| 大约15:00、下午某个时间 |
大约时间 | 带偏移量查询(见下文) |
| 18:00前到达、需要在9点到 |
到达时间 | 使用 arrive 模式 |
| 明天早上、周五10点 |
未来时间 | 使用具体日期时间 |
处理大约时间查询
当用户想要大约某个时间的选择时,提前15-30分钟查询以显示前后选项:
bash
用户:我想大约15:00出发
在14:30查询,获取14:30-16:00+的选项
./journey.sh ... 14:30 depart
相对时间计算
将相对时间转换为绝对时间:
| 用户说 | 当前时间:14:00 | 查询时间 |
|---|
| 30分钟后 | -> | 14:30 |
| 1小时后 |
-> | 15:00 |
| 2小时后 | -> | 16:00 |
LLM 响应格式
在向用户展示行程结果时,使用以下表情符号和格式指南。
表情符号参考
| 表情符号 | 用途 |
|---|
| bus | 公交(Tabussen/Ultra) |
| train |
火车 |
| walk | 步行段 |
| clock | 时间/时长 |
| clock1 | 出发时间 |
| goal | 到达时间 |
| pin | 站点/车站 |
| house | 起点(家/出发地) |
| target | 目的地 |
| warning | 延误或中断 |
| check | 准点 |
| arrows_counterclockwise | 换乘/转车 |
响应结构
始终包含工具输出中的以下关键要素:
- 1. 何时出发 - 用户需要开始行动的实际时间(包括步行)
- 步行段 - 步行的距离和时间
- 交通工具出发 - 公交实际发车时间
- 到达时间 - 用户到达目的地的时间
- 线路编号和方向 - 乘坐哪路公交
示例响应格式
简单直达行程:
现在出发 从 Vasaplan
Vasaplan -> Universitetet
1路公交(往 Mariehem方向)09:07发车
09:18到达 Universitetet
总计:11分钟
带换乘的行程:
08:45出发
步行300米到 Vasaplan(约4分钟)
Vasaplan -> Umeå C -> Skellefteå
第一段:
1路公交 08:51发车
09:05到达 Umeå C
在 Umeå C 换乘(15分钟)
第二段:
100路公交(往 Skellefteå方向)09:20发车
11:45到达 Skellefteå 公交站
总计:3小时 | 1次换乘
步行段详情
始终显示步行详情:
- - 距离(米)
- 将步行纳入出发时间计算
- 步行时间估算:约每分钟100米(正常步行速度)
展示多个选项
在展示行程选项时,确保时间清晰明了:
我为您找到了3个选项:
选项1 - 现在出发(09:00) 推荐
步行5分钟 -> 1路公交 09:07发车 -> 09:25到达
总计:25分钟
选项2 - 15分钟后出发(09:15)
步行5分钟 -> 1路公交 09:22发车 -> 09:40到达
总计:25分钟
选项3 - 30分钟后出发(09:30)
步行5分钟 -> 8路公交 09:37发车 -> 09:48到达
总计:18分钟 | 更快但出发较晚
哪个最适合您?
LLM 工作流程:如何规划行程
当用户请求行程时,请遵循以下工作流程:
第1步:理解时间意图
解析用户的需求:
- - 我怎么去... -> 立即出发
- 我需要在18:00到达 -> 到达模式
- 下午3点左右 -> 查询14:30,显示范围
- 大约一小时后 -> 从当前时间计算
第2步:搜索两个地点
分别搜索起点和终点:
bash
./search-location.sh Vasaplan?
./search-location.sh Universitetet?
第3步:验证搜索结果
仔细检查每个结果:
- 1. 完全匹配或接近匹配? - 如果名称与用户要求的一致,则继续。
- 2. 返回了多个结果? - 脚本最多显示10个匹配项。如果第一个结果不明确正确,请用户确认。
- 3. 名称差异很大? - 如果用户要求大学而结果显示Umeå Universitet,请与用户确认。
- 4. 未找到结果? - 尝试替代策略(见下文)。
第4步:处理模糊或失败的搜索
当结果不匹配或模糊时,提出澄清问题:
我搜索了centrum,找到了多个地点:
- 1. Umeå Vasaplan(中央公交枢纽)
- Skellefteå centrum
- Lycksele centrum
您指的是哪一个?
当未找到结果时,尝试以下策略:
- 1. 尝试加上城市名称:
bash
# 如果Storgatan 10失败,尝试:
./search-location.sh Storgatan 10, Umeå?
- 2. 尝试常见变体:
bash
# Universitetet -> Umeå universitet
# Sjukhuset -> NUS 或 Norrlands universitetssjukhus
- 3. 使用模糊搜索(添加 ?):
bash
./search-location.sh univ?
###