Skip to main content
Glama

get-station-by-telecode

Retrieve detailed station information using the 3-letter telecode, including name, pinyin, and city data for Chinese railway queries and debugging purposes.

Instructions

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

Input Schema

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

Implementation Reference

  • The handler function executes the tool logic: checks if the station exists in the preloaded STATIONS map by telecode and returns the full station details as JSON or an error.
    async ({ stationTelecode }) => {
      if (!STATIONS[stationTelecode]) {
        return {
          content: [{ type: 'text', text: 'Error: Station not found. ' }],
        };
      }
      return {
        content: [
          { type: 'text', text: JSON.stringify(STATIONS[stationTelecode]) },
        ],
      };
    }
  • Zod schema defining the input parameter 'stationTelecode' as a string with description.
    {
      stationTelecode: z
        .string()
        .describe('车站的 `station_telecode` (3位字母编码)'),
    },
  • src/index.ts:662-682 (registration)
    Registration of the tool using server.tool(), including name, description, schema, and inline handler function.
    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]) },
          ],
        };
      }
    );
  • Preloaded global STATIONS map (keyed by station_code/telecode) populated by getStations() function, directly used in the handler.
    const STATIONS: Record<string, StationData> = await getStations(); //以Code为键
  • TypeScript type definition for StationData, which structures the output data returned by the tool.
    export type StationData = {
      station_id: string;
      station_name: string;
      station_code: string;
      station_pinyin: string;
      station_short: string;
      station_index: string;
      code: string;
      city: string;
      r1: string;
      r2: string;
    };
Behavior3/5

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

With no annotations provided, the description carries full burden. It describes the query behavior (lookup by telecode) and typical use cases, but doesn't disclose important behavioral traits like error handling, response format, whether it's read-only, performance characteristics, or authentication requirements. The description adds some context about usage frequency but lacks operational details.

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 efficiently structured in two sentences: first states the core functionality, second provides usage context. Every phrase adds value with no redundancy. It's appropriately sized for a single-parameter lookup 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 simple lookup tool with 100% schema coverage but no annotations or output schema, the description provides adequate purpose and usage context. However, it lacks details about return values, error conditions, and operational constraints that would be helpful given the absence of structured output documentation. The description is complete enough for basic understanding but has gaps.

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 fully documents the single parameter. The description mentions 'station_telecode' but adds no additional semantic context beyond what's in the schema (3-letter code). The baseline is 3 when schema does the heavy lifting, and the description doesn't compensate with extra parameter insights.

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 tool's purpose: query station details by station_telecode, listing specific information returned (name, pinyin, city). It distinguishes from siblings by focusing on telecode lookup rather than name-based or city-based searches. However, it doesn't explicitly name alternative tools for different query types.

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 provides clear context about when to use this tool: 'when telecode is known' and for 'special queries/debugging.' It explicitly states this tool is 'less commonly triggered directly in user conversations,' which helps guide usage frequency. However, it doesn't name specific alternative tools for different scenarios.

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

Install Server

Other Tools

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