get_ovfiets
Check real-time availability of OV-fiets rental bikes at Dutch train stations to plan your onward journey from the station.
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)The core handler function that executes the tool logic by querying the NS Places API (/places-api/v2/ovfiets) for OV-fiets bike availability at the given station code.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 defining the input arguments (stationCode: string) and type guard function for validating get_ovfiets tool inputs.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-147 (registration)Tool registration in the stdio server (src/index.ts), including name, description, and input schema advertised to MCP clients.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/http-server.ts:264-276 (registration)Tool registration in the HTTP server (src/http-server.ts), including name, description, and input schema advertised to MCP clients.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/http-server.ts:448-457 (helper)Dispatch handler in HTTP server that validates args and calls the NSApiService.getOVFiets method.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); }