Skip to main content
Glama
KallivdH

NS Travel Information Server

by KallivdH

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
NameRequiredDescriptionDefault
stationCodeYesStation code to check OV-fiets availability for (e.g., ASD for Amsterdam Centraal)

Implementation Reference

  • 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; }
  • 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); }
  • 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); }

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/KallivdH/ns-mcp-server'

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