UNPKG

@siva-sub/mcp-public-transport

Version:

A Model Context Protocol server for Singapore transport data with real-time information and routing

66 lines (65 loc) 1.92 kB
import { BaseTool, ToolDefinition } from '../base.js'; import { LTAService } from '../../services/lta.js'; import { OneMapService } from '../../services/onemap.js'; import { BusService } from '../../types/transport.js'; export interface NearbyAmenity { name: string; type: 'shopping' | 'food' | 'transport' | 'healthcare' | 'education' | 'recreation' | 'other'; distance: number; walkingTime: number; coordinates?: { latitude: number; longitude: number; }; } export interface AccessibilityInfo { wheelchairAccessible: boolean; sheltered: boolean; seatingAvailable: boolean; tactilePaving: boolean; audioAnnouncements: boolean; notes?: string; } export interface BusStopDetails { busStopCode: string; description: string; roadName: string; coordinates: { latitude: number; longitude: number; }; services: BusService[]; nearbyStops: Array<{ busStopCode: string; description: string; distance: number; walkingTime: number; servicesCount: number; }>; nearbyAmenities: NearbyAmenity[]; accessibility: AccessibilityInfo; locationContext: { district?: string; area?: string; landmarks: string[]; transportHubs: string[]; }; operationalInfo: { operatingHours: string; lastUpdated: string; dataSource: string; }; } export declare class BusStopDetailsTool extends BaseTool { private ltaService; private oneMapService; constructor(ltaService: LTAService, oneMapService: OneMapService); getDefinitions(): ToolDefinition[]; canHandle(toolName: string): boolean; execute(toolName: string, args: unknown): Promise<any>; private getNearbyStops; private getNearbyAmenities; private categorizeAmenity; private inferAccessibilityInfo; private getLocationContext; }