Skip to main content
Glama
leynier

MCP System Bridge

by leynier

get_current_date_info

Read-only

Retrieve current date and time details including year, month, day, timestamps, ISO formats, and calendar metadata.

Instructions

Get comprehensive information about the current date.

Returns:
    DateInfo: A dictionary containing comprehensive date and time information:
        - full_datetime (str): Full date and time in YYYY-MM-DD HH:MM:SS format
        - iso_date (str): ISO 8601 date format (YYYY-MM-DD)
        - iso_datetime (str): ISO 8601 datetime format with timezone
        - timestamp (int): Unix timestamp (seconds since epoch)
        - year (int): Current year (e.g., 2024)
        - month (int): Current month (1-12)
        - day (int): Current day of the month (1-31)
        - day_of_year (int): Day number in the year (1-366)
        - day_of_week_number (int): Day of the week (0=Monday, 6=Sunday)
        - day_name (str): Full name of the day (e.g., "Monday")
        - day_name_short (str): Short name of the day (e.g., "Mon")
        - month_name (str): Full name of the month (e.g., "January")
        - month_name_short (str): Short name of the month (e.g., "Jan")
        - is_leap_year (bool): True if current year is a leap year
        - week_number (int): ISO 8601 week number (1-53)
        - iso_year (int): ISO 8601 year (may differ from calendar year)
        - weekday_iso (int): ISO weekday (1=Monday, 7=Sunday)
        - quarter (int): Quarter of the year (1-4)
        - days_in_month (int): Total days in the current month
        - hour (int): Current hour (0-23)
        - minute (int): Current minute (0-59)
        - second (int): Current second (0-59)
        - microsecond (int): Current microsecond (0-999999)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the get_current_date_info tool. Computes and returns comprehensive current date/time information (e.g., day, month, year, day_of_year, weekday, ISO week, quarter, leap year, etc.) as a DateInfo Pydantic model.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True))
    def get_current_date_info() -> DateInfo:
        """
        Get comprehensive information about the current date.
    
        Returns:
            DateInfo: A dictionary containing comprehensive date and time information:
                - full_datetime (str): Full date and time in YYYY-MM-DD HH:MM:SS format
                - iso_date (str): ISO 8601 date format (YYYY-MM-DD)
                - iso_datetime (str): ISO 8601 datetime format with timezone
                - timestamp (int): Unix timestamp (seconds since epoch)
                - year (int): Current year (e.g., 2024)
                - month (int): Current month (1-12)
                - day (int): Current day of the month (1-31)
                - day_of_year (int): Day number in the year (1-366)
                - day_of_week_number (int): Day of the week (0=Monday, 6=Sunday)
                - day_name (str): Full name of the day (e.g., "Monday")
                - day_name_short (str): Short name of the day (e.g., "Mon")
                - month_name (str): Full name of the month (e.g., "January")
                - month_name_short (str): Short name of the month (e.g., "Jan")
                - is_leap_year (bool): True if current year is a leap year
                - week_number (int): ISO 8601 week number (1-53)
                - iso_year (int): ISO 8601 year (may differ from calendar year)
                - weekday_iso (int): ISO weekday (1=Monday, 7=Sunday)
                - quarter (int): Quarter of the year (1-4)
                - days_in_month (int): Total days in the current month
                - hour (int): Current hour (0-23)
                - minute (int): Current minute (0-59)
                - second (int): Current second (0-59)
                - microsecond (int): Current microsecond (0-999999)
        """
        now = datetime.now()
        current_date = now.date()
    
        # Basic date information
        day = current_date.day
        month = current_date.month
        year = current_date.year
    
        # Day of the year (1-366)
        day_of_year = current_date.timetuple().tm_yday
    
        # Day of the week (0=Monday, 6=Sunday)
        day_of_week_number = current_date.weekday()
    
        # Day names
        day_name_english = current_date.strftime("%A")
        day_name_short_english = current_date.strftime("%a")
    
        # Month names
        month_name_english = current_date.strftime("%B")
        month_name_short_english = current_date.strftime("%b")
    
        # Check if leap year
        is_leap_year = calendar.isleap(year)
    
        # Week number (ISO 8601)
        year_iso, week_number, weekday_iso = current_date.isocalendar()
    
        # Days in current month
        days_in_month = calendar.monthrange(year, month)[1]
    
        # Quarter
        quarter = (month - 1) // 3 + 1
    
        # Full datetime string
        full_datetime = now.strftime("%Y-%m-%d %H:%M:%S")
    
        # ISO format
        iso_date = current_date.isoformat()
        iso_datetime = now.isoformat()
    
        # Timestamp
        timestamp = int(now.timestamp())
    
        return DateInfo(
            full_datetime=full_datetime,
            iso_date=iso_date,
            iso_datetime=iso_datetime,
            timestamp=timestamp,
            year=year,
            month=month,
            day=day,
            day_of_year=day_of_year,
            day_of_week_number=day_of_week_number,
            day_name=day_name_english,
            day_name_short=day_name_short_english,
            month_name=month_name_english,
            month_name_short=month_name_short_english,
            is_leap_year=is_leap_year,
            week_number=week_number,
            iso_year=year_iso,
            weekday_iso=weekday_iso,
            quarter=quarter,
            days_in_month=days_in_month,
            hour=now.hour,
            minute=now.minute,
            second=now.second,
            microsecond=now.microsecond,
        )
  • Pydantic BaseModel (schema) defining the return type for get_current_date_info, with all date/time fields.
    class DateInfo(BaseModel):
        """Type definition for date information returned by get_current_date_info."""
    
        full_datetime: str
        iso_date: str
        iso_datetime: str
        timestamp: int
        year: int
        month: int
        day: int
        day_of_year: int
        day_of_week_number: int
        day_name: str
        day_name_short: str
        month_name: str
        month_name_short: str
        is_leap_year: bool
        week_number: int
        iso_year: int
        weekday_iso: int
        quarter: int
        days_in_month: int
        hour: int
        minute: int
        second: int
        microsecond: int
  • src/server.py:95-95 (registration)
    The @mcp.tool decorator registers get_current_date_info as a MCP tool.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True))
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true. The description adds value by listing return fields but does not disclose behaviors beyond that (e.g., caching, timezone source). With annotations, the bar is higher; description does not enrich beyond the read-only nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose sentence is front-loaded. The extensive list of return fields is informative but somewhat verbose. Could be more concise, but structure is clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter informational tool with annotations, the description thoroughly explains all return values. No output schema exists, so the description fulfills completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, and input schema is empty with 100% coverage. Description does not need to add parameter info; baseline 4 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get comprehensive information about the current date' with a specific verb and resource. Siblings are entirely different (clipboard, URLs, notifications), so no confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit 'when to use' or alternatives mentioned, but the tool is self-explanatory and siblings are unrelated, so usage context is clear implicitly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/leynier/mcp-sys-bridge'

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