Skip to main content
Glama
KallivdH

NS Travel Information Server

by KallivdH

get_disruptions

Retrieve current and planned Dutch railway disruptions including maintenance work, alternative transport options, and travel impact details to help plan your journey effectively.

Instructions

Get comprehensive information about current and planned disruptions on the Dutch railway network. Returns details about maintenance work, unexpected disruptions, alternative transport options, impact on travel times, and relevant advice. Can filter for active disruptions and specific disruption types.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
isActiveNoFilter to only return active disruptions
typeNoType of disruptions to return (e.g., MAINTENANCE, DISRUPTION)

Implementation Reference

  • Core handler function that performs the HTTP request to the NS API disruptions endpoint, applying the provided filters (isActive, type), and returns the list of Disruption objects.
    async getDisruptions(args: GetDisruptionsArgs): Promise<Disruption[]> { this.ensureApiKeyConfigured(); const response = await this.axiosInstance.get<Disruption[]>( NSApiService.ENDPOINTS.DISRUPTIONS, { params: { isActive: args.isActive, type: args.type, }, } ); return response.data; }
  • MCP CallToolRequestSchema handler case for 'get_disruptions': validates input arguments and delegates execution to NSApiService.getDisruptions, then formats the response.
    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); }
  • Input schema definition (GetDisruptionsArgs interface) and type guard validator (isValidDisruptionsArgs) for the tool arguments.
    export interface GetDisruptionsArgs { isActive?: boolean; // Filter for active disruptions only type?: DisruptionType; // Type of disruption to filter for } /** * Type guard for disruption arguments */ export function isValidDisruptionsArgs(args: unknown): args is GetDisruptionsArgs { if (!args || typeof args !== "object") { return false; } const typedArgs = args as Record<string, unknown>; // Check isActive: should be undefined or boolean if (typedArgs.isActive !== undefined && typeof typedArgs.isActive !== "boolean") { return false; } // Check type: should be undefined or one of the allowed values if (typedArgs.type !== undefined && (typeof typedArgs.type !== "string" || !["MAINTENANCE", "DISRUPTION"].includes(typedArgs.type))) { return false; } return true; }
  • src/index.ts:54-70 (registration)
    Tool registration in the ListToolsRequestSchema response, defining name, description, and inputSchema for the get_disruptions tool.
    name: 'get_disruptions', description: 'Get comprehensive information about current and planned disruptions on the Dutch railway network. Returns details about maintenance work, unexpected disruptions, alternative transport options, impact on travel times, and relevant advice. Can filter for active disruptions and specific disruption types.', inputSchema: { type: 'object', properties: { isActive: { type: 'boolean', description: 'Filter to only return active disruptions', }, type: { type: 'string', description: 'Type of disruptions to return (e.g., MAINTENANCE, DISRUPTION)', enum: ['MAINTENANCE', 'DISRUPTION'] }, }, }, },
  • Output type definition for Disruption objects returned by the tool.
    export interface Disruption { type: string; id: string; title: string; isActive: boolean; topic?: string; local: boolean; description?: string; titleSections?: TitleSection[][]; registrationTime: string; releaseTime: string; start: string; end: string; phase?: Phase; impact: Impact; expectedDuration?: ExpectedDuration; publicationSections: PublicationSection[]; summaryAdditionalTravelTime?: AdditionalTravelTime; timespans: Timespan[]; alternativeTransportTimespans: AlternativeTransportTimespan[]; }

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