File tree Expand file tree Collapse file tree
src/time/src/mcp_server_time Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class TimeTools(str, Enum):
2222class TimeResult (BaseModel ):
2323 timezone : str
2424 datetime : str
25+ day_of_week : str
2526 is_dst : bool
2627
2728
@@ -64,6 +65,7 @@ def get_current_time(self, timezone_name: str) -> TimeResult:
6465 return TimeResult (
6566 timezone = timezone_name ,
6667 datetime = current_time .isoformat (timespec = "seconds" ),
68+ day_of_week = current_time .strftime ("%A" ),
6769 is_dst = bool (current_time .dst ()),
6870 )
6971
@@ -104,11 +106,13 @@ def convert_time(
104106 source = TimeResult (
105107 timezone = source_tz ,
106108 datetime = source_time .isoformat (timespec = "seconds" ),
109+ day_of_week = source_time .strftime ("%A" ),
107110 is_dst = bool (source_time .dst ()),
108111 ),
109112 target = TimeResult (
110113 timezone = target_tz ,
111114 datetime = target_time .isoformat (timespec = "seconds" ),
115+ day_of_week = target_time .strftime ("%A" ),
112116 is_dst = bool (target_time .dst ()),
113117 ),
114118 time_difference = time_diff_str ,
You can’t perform that action at this time.
0 commit comments