get_current_datetime
Retrieve the current system date and time for time-sensitive operations such as cart checkout or order history comparisons. Returns a dictionary with detailed datetime information.
Instructions
Get the current system date and time.
This tool is useful for comparing with cart checkout dates, order history,
or any other time-sensitive operations.
Returns:
Dictionary containing current date and time information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The main handler function for the 'get_current_datetime' tool, decorated with @mcp.tool() and returning current datetime in multiple formats.@mcp.tool() async def get_current_datetime(ctx: Context = None) -> Dict[str, Any]: """ Get the current system date and time. This tool is useful for comparing with cart checkout dates, order history, or any other time-sensitive operations. Returns: Dictionary containing current date and time information """ now = datetime.now() return { "success": True, "datetime": now.isoformat(), "date": now.date().isoformat(), "time": now.time().isoformat(), "timestamp": int(now.timestamp()), "formatted": now.strftime("%A, %B %d, %Y at %I:%M:%S %p") }
- src/kroger_mcp/server.py:77-77 (registration)Registers the utility tools, including 'get_current_datetime', by calling the register_tools function.utility_tools.register_tools(mcp)