From 6b8d4b5a23b27862dfef2d2c395f1d80c6d23512 Mon Sep 17 00:00:00 2001 From: Niels Kaspers Date: Sun, 15 Mar 2026 09:06:47 +0200 Subject: [PATCH] feat(time): add tool annotations to get_current_time and convert_time (#3574) --- src/time/src/mcp_server_time/server.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/time/src/mcp_server_time/server.py b/src/time/src/mcp_server_time/server.py index e10d6b4eed..83e97af333 100644 --- a/src/time/src/mcp_server_time/server.py +++ b/src/time/src/mcp_server_time/server.py @@ -8,7 +8,7 @@ from mcp.server import Server from mcp.server.stdio import stdio_server -from mcp.types import Tool, TextContent, ImageContent, EmbeddedResource, ErrorData, INVALID_PARAMS +from mcp.types import Tool, ToolAnnotations, TextContent, ImageContent, EmbeddedResource, ErrorData, INVALID_PARAMS from mcp.shared.exceptions import McpError from pydantic import BaseModel @@ -142,6 +142,12 @@ async def list_tools() -> list[Tool]: }, "required": ["timezone"], }, + annotations=ToolAnnotations( + readOnlyHint=True, + destructiveHint=False, + idempotentHint=True, + openWorldHint=False, + ), ), Tool( name=TimeTools.CONVERT_TIME.value, @@ -164,6 +170,12 @@ async def list_tools() -> list[Tool]: }, "required": ["source_timezone", "time", "target_timezone"], }, + annotations=ToolAnnotations( + readOnlyHint=True, + destructiveHint=False, + idempotentHint=True, + openWorldHint=False, + ), ), ]