AI Agent Hub
Back to plugins
🧰

xby-12306-ticket-purchase-search

Web Tools Updated 2026.09.02

Run the following command in DeepSeek Harness:

dsh plugin install xby-skill/xby-12306-ticket-purchase-search

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install xby-skill/xby-12306-ticket-purchase-search in the DeepSeek Harness terminal to install this plugin; the full source code is available at https://github.com/xby-skill/xby-12306-ticket-purchase-search

About this plugin

Large language models have no native way to query 12306 for rail ticket availability. When a user asks "what trains run from Beijing to Shanghai tomorrow," the model can only produce a generic template answer with no real seat data. xby-12306-ticket-purchase-search wraps 12306 search into a structured Model Context Protocol (MCP) toolset, letting models make real API calls for seat availability, transfer routes, and per-stop schedules, filling the critical data gap in travel-related conversations.

The plugin covers the full chain from natural language to structured queries: it resolves station codes from Chinese city or station names, parses relative dates such as "tomorrow" or "next Wednesday" in the Shanghai timezone (Asia/Shanghai, UTC+8), returns direct-train availability, the top-ten transfer options, and detailed intermediate stops including arrival, departure, and dwell times for a given train number. A telecode reverse-lookup is also available for debugging. The API key only needs to be set once in conversation; it is auto-persisted and survives restarts, so authentication is a one-time step.

Best suited for developers building travel-oriented AI agents, orchestration platforms, or consumer products that promise "ask once, get real seat availability." An API key from the xby platform is required. The project is MIT-licensed and fully open source, ready to be integrated or extended.

Use Cases

  • When a user asks about train availability between two cities, the model calls the API and returns real seat and train data
  • When a transfer route is needed, the plugin returns the top-ten transfer options for selection
  • When a user wants intermediate stops, arrival/departure times, and dwell durations for a specific train, the plugin provides detailed interval information

Best For

  • Developers building travel or mobility AI agents
  • Product teams that need real-time rail ticket data for consumer applications
  • Orchestration platform engineers integrating the MCP toolchain