When developing DSH agents, integrating external data sources is a common requirement. If you need to integrate Caltrain train schedules, directly calling third-party APIs and maintaining the integration logic increases development costs. The xby-caltrain plugin is based on GTFS data and provides ready-to-use query interfaces, allowing you to quickly add transportation information lookup capabilities to an agent.

Functional Description

This is an online tool plugin for DeepSeek Harness (DSH), maintained by the user xby_skill. It primarily addresses the need to query Caltrain train schedules and station information during agent conversations.

Core features include:

  1. set_xby_apikey: Sets an API key in chat. This setting is persisted automatically and remains valid after restarting the DSH process.
  2. next_trains: Queries the next Caltrain departure times. It supports common station abbreviations (such as ‘SF’ and ‘SJ’). If no specific time is provided, it defaults to querying departures after the current time.
  3. list_stations: Lists all available Caltrain stations. Use this tool to verify station spelling when next_trains returns a “Station not found” error.

Installation and Configuration

Before using this plugin, you must obtain an API key. Please register on the official Xiaobenyang website and get your key.

The installation command is as follows:

dsh plugin --profile web add github:xby_skill/xby-caltrain

Typical Usage

After installation, you can directly call the above tools in a DSH chat.

# 查询从旧金山到圣何塞的下一班列车
next_trains(origin='SF', destination='SJ')

# 查询特定时间点的班次
next_trains(origin='San Jose Diridon', destination='San Francisco')

# 查看所有可用站点
list_stations()

Notes

  • API key: You must first call set_xby_apikey to set the key; otherwise, the query functionality will be unavailable.
  • Station names: If you encounter a “Station not found” error, run list_stations() first to view the list of station names supported by the system. The entered name must match the names in the list (the system is case-insensitive, but it may be sensitive to spaces).

This plugin is licensed under the MIT License. The source code is available on GitHub.