get_current_date
Retrieve the current date in YYYY-MM-DD format for use with MLB statistics and baseball data operations.
Instructions
Get the current date.
Returns: str: The current date in YYYY-MM-DD format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- generic_api.py:7-18 (handler)The handler function for the 'get_current_date' MCP tool. It uses @mcp.tool() decorator to define and register the tool logic, returning the current date in YYYY-MM-DD format or an error message.@mcp.tool() def get_current_date() -> str: """Get the current date. Returns: str: The current date in YYYY-MM-DD format """ try: current_date = datetime.now().strftime("%Y-%m-%d") return current_date except Exception as e: return f"Error getting current date: {e!s}"
- main.py:23-23 (registration)The call to setup_generic_tools(mcp) in the main server setup, which executes the tool definitions including get_current_date.setup_generic_tools(mcp)
- generic_api.py:9-13 (schema)The docstring in the get_current_date handler defines the tool's description and output schema (str in YYYY-MM-DD format)."""Get the current date. Returns: str: The current date in YYYY-MM-DD format """
- generic_api.py:4-5 (helper)The setup_generic_tools function that contains the definitions of generic tools including get_current_date.def setup_generic_tools(mcp): """Setup generic tools for the MCP server"""