Skip to main content
Glama

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
NameRequiredDescriptionDefault

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") }
  • Registers the utility tools, including 'get_current_datetime', by calling the register_tools function.
    utility_tools.register_tools(mcp)

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/CupOfOwls/kroger-mcp'

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