get_station_info
Find detailed Dutch train station information including schedules, facilities, and accessibility for planning your NS railway journey in the Netherlands.
Instructions
Get detailed information about a train station
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Station name or code to search for | |
| includeNonPlannableStations | No | Include stations where trains do not stop regularly | |
| limit | No | Maximum number of results to return |
Implementation Reference
- src/services/NSApiService.ts:108-121 (handler)The core handler function that performs the HTTP request to the NS API stations endpoint to retrieve station information based on the query parameters.async getStationInfo(args: StationInfoArgs): Promise<StationInfoResponse> { this.ensureApiKeyConfigured(); const response = await this.axiosInstance.get<StationInfoResponse>( NSApiService.ENDPOINTS.STATIONS, { params: { q: args.query, includeNonPlannableStations: args.includeNonPlannableStations ?? false, limit: args.limit ?? 10 } } ); return response.data; }
- src/types.ts:408-421 (schema)Type definitions and validation function for the input arguments (StationInfoArgs) used by the get_station_info tool.export interface StationInfoArgs { query: string; includeNonPlannableStations?: boolean; limit?: number; } export function isValidStationInfoArgs(args: any): args is StationInfoArgs { return ( typeof args === 'object' && typeof args.query === 'string' && (args.includeNonPlannableStations === undefined || typeof args.includeNonPlannableStations === 'boolean') && (args.limit === undefined || (typeof args.limit === 'number' && args.limit >= 1 && args.limit <= 50)) ); }
- src/types.ts:465-467 (schema)Type definition for the output response (StationInfoResponse) from the NS API.export interface StationInfoResponse { payload: Station[]; }
- src/index.ts:149-174 (registration)Registration of the get_station_info tool in the ListToolsRequestHandler, including schema and description (stdio server).{ name: 'get_station_info', description: 'Get detailed information about a train station', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Station name or code to search for', }, includeNonPlannableStations: { type: 'boolean', description: 'Include stations where trains do not stop regularly', default: false }, limit: { type: 'number', description: 'Maximum number of results to return', minimum: 1, maximum: 50, default: 10 } }, required: ['query'] } },
- src/index.ts:331-340 (registration)Dispatch handler case in CallToolRequestHandler that validates arguments and calls the NSApiService.getStationInfo (stdio server).case 'get_station_info': { if (!isValidStationInfoArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_station_info' ); } const data = await this.nsApiService.getStationInfo(rawArgs); return ResponseFormatter.formatSuccess(data); }