Skip to main content
Glama
KallivdH

NS Travel Information Server

by KallivdH

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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'
      });
    }
  • 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: {}
      }
    },
  • 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'
      });
    }
  • 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: {}
      }
    },
  • 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);
      }
    });
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly states this is a read operation that returns current time in a specific format and timezone, but doesn't mention potential limitations like rate limits, authentication requirements, or whether the time is synchronized with atomic clocks.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste - the first states the core functionality with precise specifications, the second provides practical usage context. Every word serves a clear purpose in helping an agent understand and use this tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no annotations and no output schema, the description provides excellent context about what the tool does, the format it returns, and its practical application. It could be slightly more complete by explicitly stating the return type or format details, but it's very effective given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the lack of inputs. The description appropriately doesn't discuss parameters, maintaining focus on the tool's purpose and output format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get'), resource ('current server time'), and format ('RFC3339 format') with precise timezone specification ('Europe/Amsterdam timezone'). It distinguishes itself from sibling tools by focusing on time retrieval rather than transportation data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('This can be used as input for other tools that require date-time parameters'), but doesn't explicitly mention when not to use it or name specific alternative tools for time-related functions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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