Skip to main content
Glama
xiaonieli7

Flight Ticket MCP Server

by xiaonieli7

getCurrentDate

Retrieve the current date in yyyy-MM-dd format for flight booking, scheduling, and travel planning operations.

Instructions

获取当前日期 - 返回格式为 yyyy-MM-dd 的当前日期字符串

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'getCurrentDate' registered with @mcp.tool() decorator. This is the entry point executed when the tool is called, delegating to date_tools.getCurrentDate().
    @mcp.tool() def getCurrentDate(): """获取当前日期 - 返回格式为 yyyy-MM-dd 的当前日期字符串""" logger.debug("调用获取当前日期工具") return date_tools.getCurrentDate()
  • Registration of the 'getCurrentDate' tool via FastMCP @mcp.tool() decorator within the register_tools() function.
    @mcp.tool() def getCurrentDate(): """获取当前日期 - 返回格式为 yyyy-MM-dd 的当前日期字符串""" logger.debug("调用获取当前日期工具") return date_tools.getCurrentDate()
  • Core helper function implementing getCurrentDate logic, called by the MCP handler. Returns a dictionary with current date, datetime, timestamp, and query time.
    def getCurrentDate() -> Dict[str, Any]: """ 获取当前日期的工具函数 Returns: Dict[str, Any]: 包含当前日期信息的字典 """ try: current_date = DateTools.get_current_date() current_datetime = DateTools.get_current_datetime() result = { "status": "success", "current_date": current_date, "current_datetime": current_datetime, "timestamp": datetime.now().timestamp(), "query_time": datetime.now().isoformat() } logger.info(f"获取当前日期成功: {current_date}") return result except Exception as e: logger.error(f"获取当前日期失败: {str(e)}", exc_info=True) return { "status": "error", "message": f"获取当前日期失败: {str(e)}", "error_code": "GET_DATE_FAILED" }
  • Low-level static method in DateTools class that retrieves the current date as a formatted string (yyyy-MM-dd), used by getCurrentDate() helper.
    def get_current_date() -> str: """ 获取当前日期 Returns: str: 当前日期,格式为 yyyy-MM-dd """ try: current_date = datetime.now().strftime("%Y-%m-%d") logger.debug(f"获取当前日期: {current_date}") return current_date except Exception as e: logger.error(f"获取当前日期失败: {str(e)}", exc_info=True) raise e
  • Low-level static method in DateTools class that retrieves the current date and time as a formatted string (yyyy-MM-dd HH:mm:ss), used by getCurrentDate() helper.
    def get_current_datetime() -> str: """ 获取当前日期和时间 Returns: str: 当前日期时间,格式为 yyyy-MM-dd HH:mm:ss """ try: current_datetime = datetime.now().strftime("%Y-%m-%d %H:%M:%S") logger.debug(f"获取当前日期时间: {current_datetime}") return current_datetime except Exception as e: logger.error(f"获取当前日期时间失败: {str(e)}", exc_info=True) raise 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/xiaonieli7/FlightTicketMCP'

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