getCurrentESTTime
Retrieve current EVE Online server time (EST/UTC) and calculate time remaining until the next daily downtime, which occurs from 11:00 to 11:15 EST. Uses system time with WorldTimeAPI as a fallback.
Instructions
Get current EVE Server Time (EST) which is identical to UTC, and calculate time until next server downtime. EVE Online servers go offline daily from 11:00 to 11:15 EST (UTC) for maintenance. Uses system time with WorldTimeAPI as fallback.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:107-124 (handler)The MCP tool handler (execute function) for 'getCurrentESTTime'. It calls the core helper function and returns the result as formatted JSON, with error handling.execute: async () => { try { const timeInfo = await getCurrentESTTime(); return JSON.stringify(timeInfo, null, 2); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return JSON.stringify( { error: "Failed to get current time", message: errorMessage, timestamp: new Date().toISOString(), }, null, 2, ); } },
- src/server.ts:126-126 (schema)Zod schema defining the tool's input parameters: an empty object (no parameters required).parameters: z.object({}),
- src/server.ts:99-127 (registration)FastMCP tool registration for 'getCurrentESTTime', including annotations, description, handler (execute), name, and parameters schema.server.addTool({ annotations: { openWorldHint: true, // May use external API as fallback readOnlyHint: true, // This tool doesn't modify anything title: "Get Current EVE Server Time", }, description: "Get current EVE Server Time (EST) which is identical to UTC, and calculate time until next server downtime. EVE Online servers go offline daily from 11:00 to 11:15 EST (UTC) for maintenance. Uses system time with WorldTimeAPI as fallback.", execute: async () => { try { const timeInfo = await getCurrentESTTime(); return JSON.stringify(timeInfo, null, 2); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return JSON.stringify( { error: "Failed to get current time", message: errorMessage, timestamp: new Date().toISOString(), }, null, 2, ); } }, name: "getCurrentESTTime", parameters: z.object({}), });
- src/server.ts:32-75 (helper)Core helper function that implements the logic for getting current EVE Server Time (EST/UTC), calculating time until next downtime, checking if currently in downtime, with time source info.async function getCurrentESTTime() { const { source: timeSource, time: now } = await getCurrentTime(); // EVE Server Time is UTC const estTime = now.toISOString().replace("T", " ").substring(0, 19) + " EST"; // Calculate time until next downtime (11:00 UTC) const downtimeHour = 11; const downtimeMinute = 0; // Create downtime date for today const nextDowntime = new Date(now); nextDowntime.setUTCHours(downtimeHour, downtimeMinute, 0, 0); // If current time is past today's downtime, set to tomorrow's downtime if (now >= nextDowntime) { nextDowntime.setUTCDate(nextDowntime.getUTCDate() + 1); } // Calculate time difference const timeDiff = nextDowntime.getTime() - now.getTime(); const hoursUntilDowntime = Math.floor(timeDiff / (1000 * 60 * 60)); const minutesUntilDowntime = Math.floor( (timeDiff % (1000 * 60 * 60)) / (1000 * 60), ); // Check if server is currently in downtime (11:00-11:15 UTC) const currentHour = now.getUTCHours(); const currentMinute = now.getUTCMinutes(); const isInDowntime = currentHour === 11 && currentMinute < 15; return { currentTime: estTime, downtimeWindow: "11:00 to 11:15 EST (UTC)", isInDowntime, nextDowntimeStart: nextDowntime.toISOString().replace("T", " ").substring(0, 19) + " EST", timeSource, timeUntilNextDowntime: isInDowntime ? "Server is currently in downtime" : `${hoursUntilDowntime}h ${minutesUntilDowntime}m`, utcTime: now.toISOString(), }; }
- src/server.ts:80-97 (helper)Helper function to retrieve current time, preferring system clock but falling back to WorldTimeAPI if invalid.async function getCurrentTime(): Promise<{ source: string; time: Date }> { try { const now = new Date(); // Check if system time is valid (not NaN and reasonable) if (isNaN(now.getTime()) || now.getFullYear() < 2020) { throw new Error("System time appears invalid"); } return { source: "system", time: now }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); console.warn( "System time unavailable, falling back to WorldTimeAPI:", errorMessage, ); const apiTime = await fetchTimeFromAPI(); return { source: "worldtimeapi", time: apiTime }; } }