get_ovfiets
Check OV-fiets bicycle availability at Dutch train stations using station codes to plan your onward journey from NS railway stations.
Instructions
Get OV-fiets availability at a train station
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stationCode | Yes | Station code to check OV-fiets availability for (e.g., ASD for Amsterdam Centraal) |
Implementation Reference
- src/services/NSApiService.ts:95-106 (handler)Core handler function that performs the HTTP request to the NS Places API to retrieve OV-fiets (bike rental) availability at a given station.async getOVFiets(args: GetOVFietsArgs): Promise<OVFietsResponse> { this.ensureApiKeyConfigured(); const response = await this.axiosInstance.get<OVFietsResponse>( NSApiService.ENDPOINTS.OVFIETS, { params: { station_code: args.stationCode } } ); return response.data; }
- src/types.ts:395-406 (schema)TypeScript interface and validation function defining the input arguments for the get_ovfiets tool.export interface GetOVFietsArgs { stationCode: string; } export function isValidOVFietsArgs(args: unknown): args is GetOVFietsArgs { if (!args || typeof args !== "object") { return false; } const typedArgs = args as Record<string, unknown>; return typeof typedArgs.stationCode === "string"; }
- src/index.ts:136-148 (registration)Tool registration in the stdio MCP server, including name, description, and input schema.name: 'get_ovfiets', description: 'Get OV-fiets availability at a train station', inputSchema: { type: 'object', properties: { stationCode: { type: 'string', description: 'Station code to check OV-fiets availability for (e.g., ASD for Amsterdam Centraal)', } }, required: ['stationCode'] } },
- src/index.ts:320-329 (registration)Tool call handler case in the stdio MCP server that validates args and delegates to NSApiService.case 'get_ovfiets': { if (!isValidOVFietsArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_ovfiets' ); } const data = await this.nsApiService.getOVFiets(rawArgs); return ResponseFormatter.formatSuccess(data); }
- src/http-server.ts:448-457 (registration)Tool call handler case in the HTTP MCP server that validates args and delegates to NSApiService.case 'get_ovfiets': { if (!isValidOVFietsArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_ovfiets' ); } const data = await this.nsApiService.getOVFiets(rawArgs); return ResponseFormatter.formatSuccess(data); }