From 371263d1e954963e788a2c5e5919e46392b0cb92 Mon Sep 17 00:00:00 2001 From: Joe Wanko Date: Sat, 21 Mar 2026 06:10:11 -0400 Subject: [PATCH] feat(everything): add tool annotations to reference implementation Add MCP tool annotations (readOnlyHint, destructiveHint, idempotentHint) to tools in the everything server, which serves as a reference implementation for MCP features. Updated tools: - echo: readOnly, idempotent (pure function) - get-sum: readOnly, idempotent (pure computation) - get-env: readOnly, idempotent (environment lookup) - get-tiny-image: readOnly, idempotent (static image) - get-annotated-message: readOnly, idempotent (message formatting) - get-structured-content: readOnly, idempotent (content generation) - toggle-simulated-logging: not readOnly, not idempotent (state toggle) This aligns the everything server with other MCP servers (filesystem, fetch, memory, git, time) that already include tool annotations. --- src/everything/tools/echo.ts | 5 +++++ src/everything/tools/get-annotated-message.ts | 5 +++++ src/everything/tools/get-env.ts | 5 +++++ src/everything/tools/get-structured-content.ts | 5 +++++ src/everything/tools/get-sum.ts | 5 +++++ src/everything/tools/get-tiny-image.ts | 5 +++++ src/everything/tools/toggle-simulated-logging.ts | 5 +++++ 7 files changed, 35 insertions(+) diff --git a/src/everything/tools/echo.ts b/src/everything/tools/echo.ts index 204a2fb49b..2526e7cb7d 100644 --- a/src/everything/tools/echo.ts +++ b/src/everything/tools/echo.ts @@ -13,6 +13,11 @@ const config = { title: "Echo Tool", description: "Echoes back the input string", inputSchema: EchoSchema, + annotations: { + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }, }; /** diff --git a/src/everything/tools/get-annotated-message.ts b/src/everything/tools/get-annotated-message.ts index ead0660e8f..a37ecde214 100644 --- a/src/everything/tools/get-annotated-message.ts +++ b/src/everything/tools/get-annotated-message.ts @@ -21,6 +21,11 @@ const config = { description: "Demonstrates how annotations can be used to provide metadata about content.", inputSchema: GetAnnotatedMessageSchema, + annotations: { + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }, }; /** diff --git a/src/everything/tools/get-env.ts b/src/everything/tools/get-env.ts index 0adbf5a14d..bbe2f95533 100644 --- a/src/everything/tools/get-env.ts +++ b/src/everything/tools/get-env.ts @@ -8,6 +8,11 @@ const config = { description: "Returns all environment variables, helpful for debugging MCP server configuration", inputSchema: {}, + annotations: { + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }, }; /** diff --git a/src/everything/tools/get-structured-content.ts b/src/everything/tools/get-structured-content.ts index 83c98c0ab6..6f42863187 100644 --- a/src/everything/tools/get-structured-content.ts +++ b/src/everything/tools/get-structured-content.ts @@ -26,6 +26,11 @@ const config = { description: "Returns structured content along with an output schema for client data validation", inputSchema: GetStructuredContentInputSchema, + annotations: { + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }, outputSchema: GetStructuredContentOutputSchema, }; diff --git a/src/everything/tools/get-sum.ts b/src/everything/tools/get-sum.ts index 522043c88f..e5213a5ad9 100644 --- a/src/everything/tools/get-sum.ts +++ b/src/everything/tools/get-sum.ts @@ -14,6 +14,11 @@ const config = { title: "Get Sum Tool", description: "Returns the sum of two numbers", inputSchema: GetSumSchema, + annotations: { + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }, }; /** diff --git a/src/everything/tools/get-tiny-image.ts b/src/everything/tools/get-tiny-image.ts index 720707d0ce..59881b51c5 100644 --- a/src/everything/tools/get-tiny-image.ts +++ b/src/everything/tools/get-tiny-image.ts @@ -11,6 +11,11 @@ const config = { title: "Get Tiny Image Tool", description: "Returns a tiny MCP logo image.", inputSchema: {}, + annotations: { + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }, }; /** diff --git a/src/everything/tools/toggle-simulated-logging.ts b/src/everything/tools/toggle-simulated-logging.ts index 4941ed77d0..126c9263d7 100644 --- a/src/everything/tools/toggle-simulated-logging.ts +++ b/src/everything/tools/toggle-simulated-logging.ts @@ -11,6 +11,11 @@ const config = { title: "Toggle Simulated Logging", description: "Toggles simulated, random-leveled logging on or off.", inputSchema: {}, + annotations: { + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }, }; // Track enabled clients by session id