Skip to main content
Glama

Temporal Awareness MCP Server

by pmbstyle
utils.py669 B
"""Utility functions for temporal parsing.""" from datetime import datetime from dateutil import parser from zoneinfo import ZoneInfo, ZoneInfoNotFoundError def robust_parse_datetime(timestamp_str: str, tz_str: str = "UTC") -> datetime: try: dt_naive = parser.parse(timestamp_str, ignoretz=True) tz = ZoneInfo(tz_str) return dt_naive.replace(tzinfo=tz) except parser.ParserError as e: raise ValueError(f"Could not parse the timestamp string: '{timestamp_str}'") from e except ZoneInfoNotFoundError as e: raise ValueError(f"The specified timezone '{tz_str}' is not a valid IANA timezone.") from e

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/pmbstyle/temporal-awareness-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server