Skip to main content
Glama

get-station-by-telecode

Retrieve detailed Chinese railway station information, including name, pinyin, and city, using the station's 3-letter telecode. Ideal for specific queries or debugging on the 12306-MCP server.

Instructions

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

Input Schema

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

Implementation Reference

  • src/index.ts:662-682 (registration)
    Registration of the 'get-station-by-telecode' tool via server.tool(), including inline schema and handler implementation. The handler performs a simple lookup in the global STATIONS object.
    server.tool( 'get-station-by-telecode', '通过车站的 `station_telecode` 查询车站的详细信息,包括名称、拼音、所属城市等。此接口主要用于在已知 `telecode` 的情况下获取更完整的车站数据,或用于特殊查询及调试目的。一般用户对话流程中较少直接触发。', { stationTelecode: z .string() .describe('车站的 `station_telecode` (3位字母编码)'), }, async ({ stationTelecode }) => { if (!STATIONS[stationTelecode]) { return { content: [{ type: 'text', text: 'Error: Station not found. ' }], }; } return { content: [ { type: 'text', text: JSON.stringify(STATIONS[stationTelecode]) }, ], }; } );
  • The core handler function that executes the tool logic: checks if station exists in STATIONS by telecode, returns JSON details or error.
    async ({ stationTelecode }) => { if (!STATIONS[stationTelecode]) { return { content: [{ type: 'text', text: 'Error: Station not found. ' }], }; } return { content: [ { type: 'text', text: JSON.stringify(STATIONS[stationTelecode]) }, ], }; }
  • Input schema defined with Zod for the stationTelecode parameter (string, 3-letter code).
    { stationTelecode: z .string() .describe('车站的 `station_telecode` (3位字母编码)'), },

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/freestylefly/12306-mcp'

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