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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/claude_tools/datetime_tool.py:3-7 (handler)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')}" - src/claude_tools/datetime_tool.py:17-17 (registration)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) - src/claude_tools/main.py:26-26 (registration)Calls the register_datetime_tools function during MCP server initialization to register the tools.
register_datetime_tools(mcp) - src/claude_tools/main.py:5-5 (registration)Imports the registration helper for datetime tools.
from claude_tools.datetime_tool import register_datetime_tools