Skip to main content
Glama

12306-MCP 车票查询工具

魔搭部署指南实现原理架构说明

12306-MCP 是基于 Model Context Protocol(MCP)的 12306 车票信息查询服务。它把 12306 的余票、车次、车站与中转查询封装成标准 MCP 工具,供支持 MCP 的 AI 客户端(Cursor、Cherry Studio、通义灵码、Claude 等)通过 Stdio 或 SSE / Streamable HTTP 远程调用。

功能

  • 查询指定日期两地之间的 12306 车票余票与票价

  • 查询车次的具体经停站、到发时刻与历时

  • 城市 / 站名 / 站码(telecode)互查

  • 中转方案查询

  • 输出格式支持 text / csv / json

内置工具:

工具

说明

get-current-date

获取上海时区(Asia/Shanghai)当前日期

get-stations-code-in-city

查询某城市下的全部车站

get-station-code-of-citys

批量查询城市对应站码

get-station-code-by-names

站名查询站码与车站信息

get-station-by-telecode

站码反查车站详情

get-tickets

查询车票余票、票价并可过滤/排序

get-interline-tickets

查询中转车票方案

get-train-route-stations

查询车次经停站信息

Related MCP server: 12306 Train Ticket Search MCP Server

本地使用(Stdio)

环境要求:Node.js 18 及以上。

npm ci
npm start

在 MCP 客户端配置:

{
  "mcpServers": {
    "12306-mcp": {
      "command": "node",
      "args": ["/绝对路径/build/index.js"]
    }
  }
}

也可以直接运行已发布的 npm 包:

{
  "mcpServers": {
    "12306-mcp": {
      "command": "npx",
      "args": ["-y", "12306-mcp"]
    }
  }
}

远程使用(SSE / Streamable HTTP)

本地启动 HTTP 服务:

npm run start:http

默认监听 0.0.0.0:8080(可通过 --host--port 或环境变量 HOSTPORT 修改):

  • Streamable HTTP:POST /mcp

  • SSE:GET /sse,消息回传 POST /message

部署到魔搭(ModelScope)MCP 广场时,推荐选择 Stdio/npx 托管方式,平台会自动生成独立的 SSE 地址,无需自己维护 HTTP 服务。创建页面各项填法、可直接复制的“服务介绍”、以及三种部署方式的配置 JSON,见 魔搭部署指南

Docker

docker build -t 12306-mcp .

# HTTP/SSE 模式
docker run -d -p 8080:8080 12306-mcp

# Stdio 模式
docker run --rm -it 12306-mcp node build/index.js

注意事项

  • 本服务无需注册 12306 账号,也无需 API Key。

  • 服务进程启动时需要访问 kyfw.12306.cn 等 12306 站点拉取车站表与查询路径;请确保运行环境(尤其云实例)能访问 12306。

  • 12306 接口存在限流与反爬策略,仅供学习与研究使用,请勿高频滥用。

参考

License

MIT

Available Tools

8 tools
get-current-dateA

获取当前日期,以上海时区(Asia/Shanghai, UTC+8)为准,返回格式为 "yyyy-MM-dd"。主要用于解析用户提到的相对日期(如“明天”、“下周三”),提供准确的日期输入。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: the tool is fixed to Shanghai timezone (UTC+8) and returns a string in yyyy-MM-dd format. It could additionally state that it reflects the current server/system clock, but the core behavior is transparent enough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two compact sentences with no fluff. The core action (get current date) and key constraints (timezone, format) are front-loaded, followed by the practical use case. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple zero-parameter tool with no output schema, the description covers return format, timezone, and intended usage context. Nothing essential is missing for an agent to correctly invoke and interpret the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters and the schema already documents this with 100% coverage. The description adds no parameter-specific detail, which is unnecessary here. A baseline of 4 is appropriate for a zero-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb (获取/获取当前日期) and resource (current date), and adds precise scope: Shanghai timezone (Asia/Shanghai, UTC+8) and exact return format (yyyy-MM-dd). It is clearly distinct from all sibling tools, which focus on train stations and tickets, leaving no ambiguity about what this tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states the primary use case: resolving relative date expressions from users (e.g., 'tomorrow', 'next Wednesday') to provide accurate date input. It does not name alternatives or exclusions, but no similar sibling tool exists, so this is sufficient guidance for when to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-interline-ticketsB

查询12306中转余票信息。尚且只支持查询前十条。

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes查询日期,格式为 "yyyy-MM-dd"。如果用户提供的是相对日期(如“明天”),请务必先调用 `get-current-date` 接口获取当前日期,并计算出目标日期。
formatNo返回结果格式,默认为text,建议使用text。可选标志:[text, json]text
showWZNo是否显示无座车,默认不显示无座车。
sortFlagNo排序方式,默认为空,即不排序。仅支持单一标识。可选标志:[startTime(出发时间从早到晚), arriveTime(抵达时间从早到晚), duration(历时从短到长)]
toStationYes到达地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)
limitedNumNo返回的中转余票数量限制,默认为10。
fromStationYes出发地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)
sortReverseNo是否逆向排序结果,默认为false。仅在设置了sortFlag时生效。
middleStationNo中转地的中文或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)。该参数可选。
latestStartTimeNo最迟出发时间(0-24),默认为24。
trainFilterFlagsNo车次筛选条件,默认为空。从以下标志中选取多个条件组合[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)]
earliestStartTimeNo最早出发时间(0-24),默认为0。

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the behavioral disclosure burden. It does reveal a key limitation ('尚且只支持查询前十条'), which is not apparent from the schema's unlimited limitedNum parameter. However, it does not describe the return structure, error behavior, or other side-effect profile, so coverage is partial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only two short sentences with no filler, and the key limitation is included. It could be slightly more informative in the first sentence, but overall it is appropriately concise for a tool whose parameters are well-documented in the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a 12-parameter tool with no output schema and no annotations, yet the description only states the resource and a ten-result limitation. It omits the return format, how to interpret results, and any relationship to direct-ticket queries. The rich schema mitigates parameter confusion but does not make the overall description complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 12 parameters with meanings and defaults. The description adds no parameter-level detail beyond hinting at an effective ten-result cap, which actually creates slight ambiguity with the unlimited limitedNum field. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the operation ('查询') and resource ('12306中转余票信息'), and the word '中转' distinguishes it from the sibling tool get-tickets, which likely handles direct tickets. However, it does not explicitly name the alternative or state 'use this for transfer searches only,' so it stops short of full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit guidance about when to use this tool versus get-tickets or the station-lookup siblings. The transfer-ticket scope is only implicit in the description and tool name, and no exclusions or alternative conditions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-station-by-telecodeA

通过车站的 station_telecode 查询车站的详细信息,包括名称、拼音、所属城市等。此接口主要用于在已知 telecode 的情况下获取更完整的车站数据,或用于特殊查询及调试目的。一般用户对话流程中较少直接触发。

ParametersJSON Schema
NameRequiredDescriptionDefault
stationTelecodeYes车站的 `station_telecode` (3位字母编码)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses that the operation is a lookup and lists sample output fields, but it does not describe the exact return structure, error behavior, or any constraints such as case sensitivity. This leaves moderate ambiguity for a tool without an output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, with the core behavior in the first sentence and usage context in the second. There is no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple single-parameter lookup, the description provides enough detail: what the input is, what kind of data is returned, and when to use it. The absence of an output schema is partially mitigated by the sample fields, though the exact response shape is not specified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides 100% coverage for the single parameter, including its type and the '3位字母编码' format. The description only reinforces the stationTelecode concept without adding meaningful semantic detail beyond the schema, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (查询), resource (车站 by station_telecode), and expected fields (名称、拼音、所属城市). This distinguishes it from sibling tools that query by name or city, since it is explicitly keyed by telecode.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly says this is for cases where the telecode is already known, and for special/debugging use, and notes it is seldom triggered in normal conversation flow. It does not name specific sibling alternatives, but the context is sufficient for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-station-code-by-namesA

通过具体的中文车站名查询其 station_code 和车站名。

ParametersJSON Schema
NameRequiredDescriptionDefault
stationNamesYes具体的中文车站名称,例如:"北京南", "上海虹桥"。若要查询多个站点,请用|分割,比如"北京南|上海虹桥"。

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the transparency burden; it does state a read-style query behavior and the returned fields. It does not disclose not-found behavior, ordering, or exact-match caveats beyond the word '具体'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One short sentence, front-loaded with the query purpose, with no redundant phrases. It is appropriately terse while still conveying the core operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter lookup, the tool description plus the schema describes the core call correctly. It lacks an explicit return-shape and empty-result description, but the named output fields and low complexity make it mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the parameter description already provides examples and the '|' separator format. The tool description only repeats the 'specific Chinese station names' concept and adds no new parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The verb 查询 and resource (station_code and station name) are specific, and the qualifier '具体的中文车站名' makes it clear this is an exact-name lookup. It is distinguishable from telecode/city siblings, but it does not explicitly name or contrast any sibling, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool should be used when the caller has exact Chinese station names. It does not explicitly say when to prefer this over get-station-by-telecode or city-based station-code tools, and it gives no exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-station-code-of-citysB

通过中文城市名查询代表该城市的 station_code

ParametersJSON Schema
NameRequiredDescriptionDefault
citysYes要查询的城市,比如"北京"。若要查询多个城市,请用|分割,比如"北京|上海"。

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It only mentions the input and query target; it does not state that this is a read-only operation, what happens if a city is not found, how multiple cities are processed, or the structure of the returned data. The addition of '中文' as an input constraint is minor.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence. It is front-loaded with the query verb and resource, and has no filler. Every word contributes meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter read tool, the description adequately states what the tool does and what input it expects. However, it does not explain the return value (though the name implies it), nor does it help disambiguate among the sibling tools. With no output schema, some return-format information would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers 100% of the parameter, including a description and examples. The description adds a small semantic nuance ('中文' Chinese) and the notion that station_code 'represents' the city, but it is mostly redundant with the schema. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action (查询/query) on a defined resource (station_code), with an explicit input method (中文城市名/Chinese city name). It is clear on its own, but it does not explicitly distinguish itself from similar siblings like get-station-code-by-names, leaving room for confusion among the closely related tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool instead of its siblings. There are no usage conditions, exclusions, or alternative tool references. For example, the description does not explain how this differs from get-station-code-by-names or get-stations-code-in-city.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-stations-code-in-cityB

通过中文城市名查询该城市 所有 火车站的名称及其对应的 station_code,结果是一个包含多个车站信息的列表。

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes中文城市名称,例如:"北京", "上海"

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses that the tool is a read-style lookup and that the result is a list containing multiple station entries, but it does not address edge cases like invalid city names, no matching stations, or exact-match behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that front-loads the action and scope, then states the result shape. Every part earns its place with no unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter read-only lookup with no output schema, the description adequately defines the return value as a list of station names and station_code values. It is slightly limited by not covering no-results or invalid-input behavior, but it is sufficient for basic invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single city parameter is fully documented in the schema with examples, so the schema already provides the needed meaning. The description adds no new semantic information beyond restating that a Chinese city name is used.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (查询), resource (all stations in a city), and output (station names and station_code as a list). It is clear on its own, but it does not explicitly distinguish itself from the similarly named sibling get-station-code-of-citys.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool instead of its siblings. With get-station-code-of-citys being nearly identical in name, the agent has no basis for choosing between them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-ticketsB

查询12306余票信息。

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes查询日期,格式为 "yyyy-MM-dd"。如果用户提供的是相对日期(如“明天”),请务必先调用 `get-current-date` 接口获取当前日期,并计算出目标日期。
formatNo返回结果格式,默认为text,建议使用text与csv。可选标志:[text, csv, json]text
sortFlagNo排序方式,默认为空,即不排序。仅支持单一标识。可选标志:[startTime(出发时间从早到晚), arriveTime(抵达时间从早到晚), duration(历时从短到长)]
toStationYes到达地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)
limitedNumNo返回的余票数量限制,默认为0,即不限制。
fromStationYes出发地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)
sortReverseNo是否逆向排序结果,默认为false。仅在设置了sortFlag时生效。
latestStartTimeNo最迟出发时间(0-24),默认为24。
trainFilterFlagsNo车次筛选条件,默认为空,即不筛选。支持多个标志同时筛选。例如用户说“高铁票”,则应使用 "G"。可选标志:[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)]
earliestStartTimeNo最早出发时间(0-24),默认为0。

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral burden. The verb '查询' indicates a read-only lookup with no side effects, which is useful baseline information. However, the description does not mention output shape, default result behavior, or quirks beyond what the schema already states.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler and no repetition of schema details. It is minimal enough to be scannable, though slightly under-specified for the complexity of the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with no annotations and no output schema, one sentence is thin. The schema covers invocation details well, including required fields and value formats, but the description leaves gaps around return-value structure and when to choose this tool over get-interline-tickets.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3 even though the description itself adds no parameter-level meaning. The schema descriptions are rich and include relative-date handling, station-code lookup hints, and train-filter flags, so the top-level description does not need to compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a concrete verb and resource: '查询12306余票信息' (query 12306 remaining-ticket information), so the agent can identify this as a ticket-availability lookup. It does not explicitly differentiate itself from the sibling get-interline-tickets, which also searches tickets, so it stops short of full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance about when to use this tool versus get-interline-tickets or the station-lookup tools, nor any exclusions or prerequisites. The intended use is implied by the phrase '余票信息', but the agent is given no explicit selection criteria among the ticket-related siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-train-route-stationsA

查询特定列车车次在指定区间内的途径车站、到站时间、出发时间及停留时间等详细经停信息。当用户询问某趟具体列车的经停站时使用此接口。

ParametersJSON Schema
NameRequiredDescriptionDefault
formatNo返回结果格式,默认为text,建议使用text。可选标志:[text, json]text
trainCodeYes要查询的车次 `train_code`,例如"G1033"。
departDateYes列车出发的日期 (格式: yyyy-MM-dd)。如果用户提供的是相对日期,请务必先调用 `get-current-date` 解析。

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It conveys a read-only query operation ('查询') and explicitly lists the information returned: stations, arrival times, departure times, and dwell times. This is adequate transparency for a simple retrieval tool, though it does not mention failure modes or response formatting.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short, purposeful sentences. The first states the exact query scope and returned fields, and the second gives the practical trigger condition. There is no filler or repetition of schema content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a low-complexity read tool with thorough schema documentation, the description tells an agent what the tool does and when to use it. The phrase '指定区间' (specified section) is slightly ambiguous because no interval parameter exists in the schema, but the overall picture is sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides 100% coverage, with clear descriptions for trainCode, departDate, and format, including the date-format instruction to call get-current-date. The description itself adds no parameter-level meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('查询') and a specific resource ('特定列车车次的...途径车站、到站/出发时间及停留时间'), making the tool's purpose unmistakable. It does not explicitly name a sibling tool it is distinct from, though mentioning 'specific train' separates it from the station-code tools in the sibling list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes an explicit trigger: '当用户询问某趟具体列车的经停站时使用此接口' (use this interface when the user asks about stops for a specific train). It does not provide when-not-to-use guidance or name alternatives such as get-tickets, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 8 tool updatesv0.3.10
    • First observedget-current-date
    • First observedget-interline-tickets
    • First observedget-station-by-telecode
    • First observedget-station-code-by-names
    • First observedget-station-code-of-citys
    • First observedget-stations-code-in-city
    • First observedget-tickets
    • First observedget-train-route-stations

TDQS

B3.4/5.0
Disambiguation2/5

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.

Naming Consistency3/5

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.

Tool Count4/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server that allows large language models to search for and analyze Chinese railway (12306) tickets through a simple API interface.
    8
    8,313
    18
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    12306 ticket purchase search server based on Model Context Protocol (MCP). It provides a simple API interface, allowing large models to search for 12306 ticket purchasing information through the interface.
    8
    1
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables real-time flight and train ticket queries, dynamic trip tracking, and knowledge-based Q&A about rail and aviation policies.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DomainTang/12306-mcp-test'

If you have feedback or need assistance with the MCP directory API, please join our Discord server