get-current-time
Retrieve the current time in the local timezone using the MCP-timeserver. Simplify time-based operations by accessing accurate, real-time data for your applications.
Instructions
Get the current time in the configured local timezone
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_timeserver/server.py:69-75 (handler)The handler logic for the 'get-current-time' tool, which returns the current local time formatted as a TextContent object.if name == "get-current-time": return [ types.TextContent( type="text", text=f"The current time is {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}", ) ]
- src/mcp_timeserver/server.py:53-57 (registration)Tool registration in list_tools(), defining name, description, and input schema.types.Tool( name="get-current-time", description="Get the current time in the configured local timezone", inputSchema={"type": "object"}, )
- src/mcp_timeserver/server.py:56-56 (schema)Input schema for the get-current-time tool: an empty object (no parameters).inputSchema={"type": "object"},