get_current_time
Retrieve the current time in HH:MM:SS format from the MLB API MCP server for time-sensitive baseball data operations and scheduling.
Instructions
Get the current time.
Returns: str: The current time in HH:MM:SS format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- generic_api.py:20-31 (handler)The get_current_time tool handler: decorated with @mcp.tool(), returns current time as string in HH:MM:SS format, handles exceptions.@mcp.tool() def get_current_time() -> str: """Get the current time. Returns: str: The current time in HH:MM:SS format """ try: current_time = datetime.now().strftime("%H:%M:%S") return current_time except Exception as e: return f"Error getting current time: {e!s}"
- main.py:21-23 (registration)Registration of tools by calling setup_generic_tools(mcp), which defines and registers get_current_time.# Setup all MLB and generic tools setup_mlb_tools(mcp) setup_generic_tools(mcp)
- generic_api.py:22-26 (schema)Docstring schema defining the tool's purpose and return type (str). Used by @mcp.tool() for input/output schema."""Get the current time. Returns: str: The current time in HH:MM:SS format """