get-current-time
Retrieve the current time in your local timezone to synchronize applications or check system time.
Instructions
Get the current time in the configured local timezone
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get-current-time"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_timeserver/server.py:69-75 (handler)Executes the 'get-current-time' tool by returning the current local time as a formatted text content 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:46-59 (registration)Registers the 'get-current-time' tool, providing its name, description, and input schema for tool discovery.
@server.list_tools() async def handle_list_tools() -> list[types.Tool]: """ List available tools. Each tool specifies its arguments using JSON Schema validation. """ return [ types.Tool( name="get-current-time", description="Get the current time in the configured local timezone", inputSchema={"type": "object"}, ) ] - src/mcp_timeserver/server.py:53-57 (schema)Defines the tool schema including name, description, and empty input schema (no parameters required).
types.Tool( name="get-current-time", description="Get the current time in the configured local timezone", inputSchema={"type": "object"}, )