12306-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | Port number for HTTP mode when using the --port flag. If not provided, the server runs in stdio mode. | 8080 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get-current-dateA | 获取当前日期,以上海时区(Asia/Shanghai, UTC+8)为准,返回格式为 "yyyy-MM-dd"。主要用于解析用户提到的相对日期(如“明天”、“下周三”),提供准确的日期输入。 |
| get-stations-code-in-cityB | 通过中文城市名查询该城市 所有 火车站的名称及其对应的 |
| get-station-code-of-citysB | 通过中文城市名查询代表该城市的 |
| get-station-code-by-namesA | 通过具体的中文车站名查询其 |
| get-station-by-telecodeA | 通过车站的 |
| get-ticketsB | 查询12306余票信息。 |
| get-interline-ticketsB | 查询12306中转余票信息。尚且只支持查询前十条。 |
| get-train-route-stationsA | 查询特定列车车次在指定区间内的途径车站、到站时间、出发时间及停留时间等详细经停信息。当用户询问某趟具体列车的经停站时使用此接口。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| stations |
TDQS
Scored across 8 tools
The station lookup tools heavily overlap: get-stations-code-in-city and get-station-code-of-citys both map a city to station codes, differing only by 'all stations' vs 'representative station'. get-station-code-by-names and get-station-by-telecode add further lookup variants, making it easy for an agent to select the wrong one.
All tools use a get- prefix, which provides some consistency, but the station-related names are not parallel: get-stations-code-in-city, get-station-code-of-citys, get-station-code-by-names, and get-station-by-telecode follow inconsistent patterns. The 'citys' typo further reduces naming quality.
Eight tools is a reasonable size for a train travel assistant. However, four of those tools are dedicated to station-code lookup, which inflates the count and makes the surface feel slightly heavier than necessary.
Core workflows are covered: getting the current date, resolving station codes, querying direct tickets, querying transfer tickets, and retrieving train route stops. Minor gaps exist such as no explicit ticket price or train status tool, but agents can likely complete common travel queries.