get_current_time_in_rfc3339
Retrieve current server time in RFC3339 format for Amsterdam timezone to use as input for NS railway travel planning tools requiring date-time parameters.
Instructions
Get the current server time (Europe/Amsterdam timezone) in RFC3339 format. This can be used as input for other tools that require date-time parameters.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/http-server.ts:470-476 (handler)Handler implementation for the get_current_time_in_rfc3339 tool. Creates a new Date object, converts it to ISO string (RFC3339), and returns it wrapped with timezone info using ResponseFormatter.case 'get_current_time_in_rfc3339': { const now = new Date(); return ResponseFormatter.formatSuccess({ datetime: now.toISOString(), timezone: 'Europe/Amsterdam' }); }
- src/http-server.ts:303-310 (schema)Schema definition for the tool, including name, description, and empty input schema (no parameters required). Part of the tools list returned by ListToolsRequestHandler.{ name: 'get_current_time_in_rfc3339', description: 'Get the current server time (Europe/Amsterdam timezone) in RFC3339 format. This can be used as input for other tools that require date-time parameters.', inputSchema: { type: 'object', properties: {} } },
- src/index.ts:342-348 (handler)Identical handler implementation in the stdio server version of the MCP server.case 'get_current_time_in_rfc3339': { const now = new Date(); return ResponseFormatter.formatSuccess({ datetime: now.toISOString(), timezone: 'Europe/Amsterdam' }); }
- src/index.ts:176-182 (schema)Identical schema definition in the stdio server version of the MCP server.name: 'get_current_time_in_rfc3339', description: 'Get the current server time (Europe/Amsterdam timezone) in RFC3339 format. This can be used as input for other tools that require date-time parameters.', inputSchema: { type: 'object', properties: {} } },
- src/http-server.ts:410-509 (registration)Registration of the CallToolRequestHandler which dispatches to the specific tool handler based on name.this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const rawArgs = request.params.arguments || {}; try { switch (request.params.name) { case 'get_disruptions': { if (!isValidDisruptionsArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_disruptions' ); } const data = await this.nsApiService.getDisruptions(rawArgs); return ResponseFormatter.formatSuccess(data); } case 'get_travel_advice': { if (!isValidTravelAdviceArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_travel_advice' ); } const data = await this.nsApiService.getTravelAdvice(rawArgs); return ResponseFormatter.formatSuccess(data); } case 'get_departures': { if (!isValidDeparturesArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_departures' ); } const data = await this.nsApiService.getDepartures(rawArgs); return ResponseFormatter.formatSuccess(data); } 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); } 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); } case 'get_current_time_in_rfc3339': { const now = new Date(); return ResponseFormatter.formatSuccess({ datetime: now.toISOString(), timezone: 'Europe/Amsterdam' }); } case 'get_arrivals': { if (!isValidArrivalsArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_arrivals' ); } const data = await this.nsApiService.getArrivals(rawArgs); return ResponseFormatter.formatSuccess(data); } case 'get_prices': { if (!isValidPricesArgs(rawArgs)) { throw ResponseFormatter.createMcpError( ErrorCode.InvalidParams, 'Invalid arguments for get_prices' ); } const data = await this.nsApiService.getPrices(rawArgs); return ResponseFormatter.formatSuccess(data); } default: throw ResponseFormatter.createMcpError( ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}` ); } } catch (error) { return ResponseFormatter.formatError(error); } });