@siva-sub/mcp-public-transport
Version:
A Model Context Protocol server for Singapore transport data with real-time information and routing
76 lines (75 loc) • 2.58 kB
TypeScript
import { BaseTool, ToolDefinition } from '../base.js';
import { OneMapService } from '../../services/onemap.js';
import { LTAService } from '../../services/lta.js';
import { WeatherService } from '../../services/weather.js';
import { ParsedInstruction, RouteSummary } from '../../services/instructionParser.js';
import { Location } from '../../types/transport.js';
interface ComprehensiveJourneyResponse {
success: boolean;
journey: {
summary: RouteSummary;
instructions: ParsedInstruction[];
formattedInstructions: string[];
polylines: any[];
visualization: {
bounds: any;
stepMarkers: any[];
routeGeometry: any[];
};
context: {
fromLocation: Location;
toLocation: Location;
timeContext: string;
weatherNote: string;
safetyAlerts: string[];
startLandmarks?: any[];
endLandmarks?: any[];
};
};
alternatives?: any[];
metadata: {
requestTime: string;
processingTime: number;
apiCalls: number;
cacheHits: number;
};
}
export declare class ComprehensiveJourneyTool extends BaseTool {
private oneMapService;
private ltaService;
private weatherService?;
private polylineService;
private instructionParser;
private mrtExitService;
constructor(oneMapService: OneMapService, ltaService: LTAService, weatherService?: WeatherService | undefined);
getDefinitions(): ToolDefinition[];
canHandle(toolName: string): boolean;
execute(toolName: string, args: unknown): Promise<ComprehensiveJourneyResponse>;
private resolveLocation;
private selectOptimalMode;
private buildRouteOptions;
private formatInstructions;
private createVisualizationData;
private getContextInformation;
private getAlternativeRoutes;
private calculateDistance;
private getTimeContext;
private createErrorResponse;
private getWeatherRecommendations;
private getNearbyLandmarks;
private planPrimaryRoute;
private buildProperRouteOptions;
private formatDate;
private formatTime;
private processPublicTransportResponse;
private processDirectRouteResponse;
private parsePublicTransportInstructions;
private parseDirectRouteInstructions;
private mapTransitMode;
private extractPolylines;
private extractDirectPolylines;
private parseJourneyPlanInstructions;
private extractJourneyPlanPolylines;
private getTrafficAndDisruptions;
}
export {};