get-tickets
Retrieve available train ticket information from 12306 using specific station codes and travel dates. Filter results by train types for accurate search results.
Instructions
查询12306余票信息。
Input Schema
Name | Required | Description | Default |
---|---|---|---|
date | Yes | 查询日期,格式为 "yyyy-MM-dd"。如果用户提供的是相对日期(如“明天”),请务必先调用 `get-current-date` 接口获取当前日期,并计算出目标日期。 | |
fromStation | Yes | 出发地的 `station_code` 。必须是通过 `get-station-code-by-name` 或 `get-station-code-of-city` 接口查询得到的编码,严禁直接使用中文地名。 | |
toStation | Yes | 到达地的 `station_code` 。必须是通过 `get-station-code-by-name` 或 `get-station-code-of-city` 接口查询得到的编码,严禁直接使用中文地名。 | |
trainFilterFlags | No | 车次筛选条件,默认为空,即不筛选。例如用户说“高铁票”,则应使用 "G"。可选标志:[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)] |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"date": {
"description": "查询日期,格式为 \"yyyy-MM-dd\"。如果用户提供的是相对日期(如“明天”),请务必先调用 `get-current-date` 接口获取当前日期,并计算出目标日期。",
"maxLength": 10,
"minLength": 10,
"type": "string"
},
"fromStation": {
"description": "出发地的 `station_code` 。必须是通过 `get-station-code-by-name` 或 `get-station-code-of-city` 接口查询得到的编码,严禁直接使用中文地名。",
"type": "string"
},
"toStation": {
"description": "到达地的 `station_code` 。必须是通过 `get-station-code-by-name` 或 `get-station-code-of-city` 接口查询得到的编码,严禁直接使用中文地名。",
"type": "string"
},
"trainFilterFlags": {
"default": "",
"description": "车次筛选条件,默认为空,即不筛选。例如用户说“高铁票”,则应使用 \"G\"。可选标志:[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)]",
"maxLength": 8,
"pattern": "^[GDZTKOFS]*$",
"type": "string"
}
},
"required": [
"date",
"fromStation",
"toStation"
],
"type": "object"
}