get_local_time
Retrieve current local time and timezone details from your machine to determine the user's local time for accurate assistance.
Instructions
Returns the current local time and timezone information from your local machine. This helps you understand what time it is for the user you're assisting.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_simple_timeserver/server.py:18-26 (handler)The handler function for the 'get_local_time' tool, which retrieves and formats the current local time and timezone information.def get_local_time() -> str: """ Returns the current local time and timezone information from your local machine. This helps you understand what time it is for the user you're assisting. """ local_time = datetime.now() timezone = str(local_time.astimezone().tzinfo) formatted_time = local_time.strftime("%Y-%m-%d %H:%M:%S") return f"Current Time: {formatted_time}\nTimezone: {timezone}"
- mcp_simple_timeserver/server.py:12-17 (registration)Registers the 'get_local_time' tool with FastMCP using the @app.tool decorator, including title and read-only annotations.@app.tool( annotations = { "title": "Get Local Time and Timezone", "readOnlyHint": True } )