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
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the return format ('yyyy-MM-dd 字符串') which is valuable behavioral information. However, it doesn't mention timezone behavior, whether it's server-side or client-side, or any rate limits/authentication needs. It adds some context but leaves gaps.

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

Conciseness5/5

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

Perfectly concise - one sentence that states the purpose and key behavioral detail (return format). Zero wasted words, front-loaded with the core function. Every element earns its place.

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

Completeness4/5

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

For a simple 0-parameter tool that returns a date string, the description is nearly complete. It specifies the return format, which is crucial. Without an output schema, this information is valuable. The main gap is lack of timezone clarification, but otherwise sufficient for the tool's complexity.

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?

The tool has 0 parameters with 100% schema description coverage (empty schema). The description appropriately doesn't discuss parameters since none exist. It focuses correctly on the output behavior. Baseline for 0 parameters is 4.

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 the specific verb ('获取当前日期' - get current date) and resource (current date), and distinguishes from all sibling tools which are flight/weather-related. It precisely defines what the tool does without being tautological.

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

Usage Guidelines3/5

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

The description implies usage context (when you need the current date in a specific format) but doesn't explicitly state when to use this tool versus alternatives. No sibling tools overlap in functionality, so no explicit differentiation is needed, but no guidance on prerequisites or limitations is provided.

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/xiaonieli7/FlightTicketMCP'

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