Skip to main content
Glama

get_current_time

Retrieve the current date and time from the Slim MCP server to synchronize workflows, timestamp events, or check temporal data.

Instructions

Get the current date and time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool logic, returning the current local date and time as a formatted string.
    def get_current_time() -> str: """Get the current date and time. """ now = datetime.now() return f"Current date and time: {now.strftime('%Y-%m-%d %H:%M:%S')}"
  • Registers the get_current_time function as an MCP tool using the mcp.tool() decorator.
    mcp.tool()(get_current_time)
  • Helper function that registers all datetime-related tools, including get_current_time, with the MCP server instance.
    def register_datetime_tools(mcp): """Register all datetime tools with the MCP server.""" mcp.tool()(get_current_time) mcp.tool()(get_current_utc_time)
  • Calls the register_datetime_tools function during MCP server initialization to register the tools.
    register_datetime_tools(mcp)
  • Imports the registration helper for datetime tools.
    from claude_tools.datetime_tool import register_datetime_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/webdevtodayjason/slim-MCP'

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