@modelcontextprotocol/server-everything 2026.1.26 → 2026.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,9 +19,11 @@
19
19
  - `get-structured-content` (tools/get-structured-content.ts): Demonstrates structured responses. Accepts `location` input and returns both backward‑compatible `content` (a `text` block containing JSON) and `structuredContent` validated by an `outputSchema` (temperature, conditions, humidity).
20
20
  - `get-sum` (tools/get-sum.ts): For two numbers `a` and `b` calculates and returns their sum. Uses Zod to validate inputs.
21
21
  - `get-tiny-image` (tools/get-tiny-image.ts): Returns a tiny PNG MCP logo as an `image` content item with brief descriptive text before and after.
22
- - `trigger-long-running-operation` (tools/trigger-trigger-long-running-operation.ts): Simulates a multi-step operation over a given `duration` and number of `steps`; reports progress via `notifications/progress` when a `progressToken` is provided by the client.
22
+ - `trigger-long-running-operation` (tools/trigger-long-running-operation.ts): Simulates a multi-step operation over a given `duration` and number of `steps`; reports progress via `notifications/progress` when a `progressToken` is provided by the client.
23
23
  - `toggle-simulated-logging` (tools/toggle-simulated-logging.ts): Starts or stops simulated, random‑leveled logging for the invoking session. Respects the client’s selected minimum logging level.
24
24
  - `toggle-subscriber-updates` (tools/toggle-subscriber-updates.ts): Starts or stops simulated resource update notifications for URIs the invoking session has subscribed to.
25
+ - `trigger-elicitation-request` (tools/trigger-elicitation-request.ts): Issues an `elicitation/create` request using form-mode fields (strings, numbers, booleans, enums, and format validation) and returns the resulting action/content.
26
+ - `trigger-url-elicitation` (tools/trigger-url-elicitation.ts): Issues an `elicitation/create` request in URL mode (`mode: "url"`) with an `elicitationId`, or throws MCP error `-32042` (`UrlElicitationRequiredError`) when `errorPath=true`. On the error path the prerequisite elicitation it returns points at a different URL than the failing request (`https://modelcontextprotocol.io`); when the client satisfies it and retries the same call, the retry ignores `errorPath` and proceeds via the request path, so the client does not loop on the same error. The retry marker is one-shot per `(session, url, elicitationId)`: it is cleared on the recognized retry, so re-running the error path with identical arguments without an intervening prerequisite is treated as a retry and proceeds. Requires client capability `elicitation.url`.
25
27
  - `trigger-sampling-request` (tools/trigger-sampling-request.ts): Issues a `sampling/createMessage` request to the client/LLM using provided `prompt` and optional generation controls; returns the LLM's response payload.
26
28
  - `simulate-research-query` (tools/simulate-research-query.ts): Demonstrates MCP Tasks (SEP-1686) with a simulated multi-stage research operation. Accepts `topic` and `ambiguous` parameters. Returns a task that progresses through stages with status updates. If `ambiguous` is true and client supports elicitation, sends an elicitation request directly to gather clarification before completing.
27
29
  - `trigger-sampling-request-async` (tools/trigger-sampling-request-async.ts): Demonstrates bidirectional tasks where the server sends a sampling request that the client executes as a background task. Server polls for status and retrieves the LLM result when complete. Requires client to support `tasks.requests.sampling.createMessage`.
@@ -48,11 +48,15 @@ src/everything
48
48
  │ ├── get-sum.ts
49
49
  │ ├── get-tiny-image.ts
50
50
  │ ├── gzip-file-as-resource.ts
51
+ │ ├── simulate-research-query.ts
51
52
  │ ├── toggle-simulated-logging.ts
52
53
  │ ├── toggle-subscriber-updates.ts
53
54
  │ ├── trigger-elicitation-request.ts
55
+ │ ├── trigger-elicitation-request-async.ts
54
56
  │ ├── trigger-long-running-operation.ts
55
- └── trigger-sampling-request.ts
57
+ ├── trigger-sampling-request.ts
58
+ │ ├── trigger-sampling-request-async.ts
59
+ │ └── trigger-url-elicitation.ts
56
60
  └── transports
57
61
  ├── sse.ts
58
62
  ├── stdio.ts
@@ -82,8 +86,8 @@ src/everything
82
86
 
83
87
  - `architecture.md`
84
88
  - This document.
85
- - `server-instructions.md`
86
- - Human‑readable instructions intended to be passed to the client/LLM as for guidance on server use. Loaded by the server at startup and returned in the "initialize" exchange.
89
+ - `instructions.md`
90
+ - Human‑readable instructions intended to be passed to the client/LLM as guidance on server use. Loaded by the server at startup and returned in the initialize exchange.
87
91
 
88
92
  ### `prompts/`
89
93
 
@@ -129,7 +133,7 @@ src/everything
129
133
  - `echo.ts`
130
134
  - Registers an `echo` tool that takes a message and returns `Echo: {message}`.
131
135
  - `get-annotated-message.ts`
132
- - Registers an `annotated-message` tool which demonstrates annotated content items by emitting a primary `text` message with `annotations` that vary by `messageType` (`"error" | "success" | "debug"`), and optionally includes an annotated `image` (tiny PNG) when `includeImage` is true.
136
+ - Registers a `get-annotated-message` tool which demonstrates content-level annotations. Emits a primary `text` message with content `annotations` (`priority`, `audience`) that vary by `messageType` (`"error" | "success" | "debug"`), and optionally includes an annotated `image` (tiny PNG) when `includeImage` is true. All tools in this server include tool-level annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`).
133
137
  - `get-env.ts`
134
138
  - Registers a `get-env` tool that returns the current process environment variables as formatted JSON text; useful for debugging configuration.
135
139
  - `get-resource-links.ts`
@@ -147,18 +151,26 @@ src/everything
147
151
  - `GZIP_MAX_FETCH_SIZE` (bytes, default 10 MiB)
148
152
  - `GZIP_MAX_FETCH_TIME_MILLIS` (ms, default 30000)
149
153
  - `GZIP_ALLOWED_DOMAINS` (comma-separated allowlist; empty means all domains allowed)
154
+ - `simulate-research-query.ts`
155
+ - Registers a `simulate-research-query` task-based tool that demonstrates the MCP Tasks feature (SEP-1686). Simulates a multi-stage research operation with progress updates. If the query is marked as ambiguous and the client supports elicitation, it pauses mid-execution to request clarification via `elicitation/create`. Uses `server.experimental.tasks.registerToolTask()` with `execution: { taskSupport: "required" }`.
150
156
  - `trigger-elicitation-request.ts`
151
157
  - Registers a `trigger-elicitation-request` tool that sends an `elicitation/create` request to the client/LLM and returns the elicitation result.
158
+ - `trigger-url-elicitation.ts`
159
+ - Registers a `trigger-url-elicitation` tool that either sends an out-of-band URL-mode `elicitation/create` request (`mode: "url"`) including an `elicitationId` (request path) or throws `UrlElicitationRequiredError` (`-32042`) for client-handled URL elicitation (error path). On the error path the carried prerequisite elicitation points at a different URL than the failing one (`https://modelcontextprotocol.io`), and when the client satisfies it and retries the same call, the retry ignores `errorPath` and proceeds via the request path — so the client does not loop on the same error.
160
+ - `trigger-elicitation-request-async.ts`
161
+ - Registers a `trigger-elicitation-request-async` tool that demonstrates bidirectional MCP tasks for elicitation. Sends an elicitation request with task metadata, then polls the client's `tasks/get` endpoint for completion status before fetching the final result.
152
162
  - `trigger-sampling-request.ts`
153
163
  - Registers a `trigger-sampling-request` tool that sends a `sampling/createMessage` request to the client/LLM and returns the sampling result.
164
+ - `trigger-sampling-request-async.ts`
165
+ - Registers a `trigger-sampling-request-async` tool that demonstrates bidirectional MCP tasks for sampling. Sends a sampling request with task metadata, then polls the client's `tasks/get` endpoint for completion status before fetching the final result.
154
166
  - `get-structured-content.ts`
155
167
  - Registers a `get-structured-content` tool that demonstrates structuredContent block responses.
156
168
  - `get-sum.ts`
157
- - Registers an `get-sum` tool with a Zod input schema that sums two numbers `a` and `b` and returns the result.
169
+ - Registers a `get-sum` tool with a Zod input schema that sums two numbers `a` and `b` and returns the result.
158
170
  - `get-tiny-image.ts`
159
171
  - Registers a `get-tiny-image` tool, which returns a tiny PNG MCP logo as an `image` content item, along with surrounding descriptive `text` items.
160
172
  - `trigger-long-running-operation.ts`
161
- - Registers a `long-running-operation` tool that simulates a long-running task over a specified `duration` (seconds) and number of `steps`; emits `notifications/progress` updates when the client supplies a `progressToken`.
173
+ - Registers a `trigger-long-running-operation` tool that simulates a long-running task over a specified `duration` (seconds) and number of `steps`; emits `notifications/progress` updates when the client supplies a `progressToken`.
162
174
  - `toggle-simulated-logging.ts`
163
175
  - Registers a `toggle-simulated-logging` tool, which starts or stops simulated logging for the invoking session.
164
176
  - `toggle-subscriber-updates.ts`
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Tracks registered session resources by URI to allow updating/removing on re-registration.
3
+ * This prevents "Resource already registered" errors when a tool creates a resource
4
+ * with the same URI multiple times during a session.
5
+ */
6
+ const registeredResources = new Map();
1
7
  /**
2
8
  * Generates a session-scoped resource URI string based on the provided resource name.
3
9
  *
@@ -34,11 +40,19 @@ export const registerSessionResource = (server, resource, type, payload) => {
34
40
  mimeType,
35
41
  blob: payload,
36
42
  };
43
+ // Check if a resource with this URI is already registered and remove it
44
+ const existingResource = registeredResources.get(uri);
45
+ if (existingResource) {
46
+ existingResource.remove();
47
+ registeredResources.delete(uri);
48
+ }
37
49
  // Register file resource
38
- server.registerResource(name, uri, { mimeType, description, title, annotations, icons, _meta }, async (uri) => {
50
+ const registeredResource = server.registerResource(name, uri, { mimeType, description, title, annotations, icons, _meta }, async () => {
39
51
  return {
40
52
  contents: [resourceContent],
41
53
  };
42
54
  });
55
+ // Track the registered resource for potential future removal
56
+ registeredResources.set(uri, registeredResource);
43
57
  return { type: "resource_link", ...resource };
44
58
  };
@@ -9,6 +9,12 @@ const config = {
9
9
  title: "Echo Tool",
10
10
  description: "Echoes back the input string",
11
11
  inputSchema: EchoSchema,
12
+ annotations: {
13
+ readOnlyHint: true,
14
+ destructiveHint: false,
15
+ idempotentHint: true,
16
+ openWorldHint: false,
17
+ },
12
18
  };
13
19
  /**
14
20
  * Registers the 'echo' tool.
@@ -16,6 +16,12 @@ const config = {
16
16
  title: "Get Annotated Message Tool",
17
17
  description: "Demonstrates how annotations can be used to provide metadata about content.",
18
18
  inputSchema: GetAnnotatedMessageSchema,
19
+ annotations: {
20
+ readOnlyHint: true, // This tool only returns data, no side effects
21
+ destructiveHint: false, // Does not delete or modify anything
22
+ idempotentHint: true, // Same input always produces same output
23
+ openWorldHint: false, // Does not interact with external systems
24
+ },
19
25
  };
20
26
  /**
21
27
  * Registers the 'get-annotated-message' tool.
@@ -4,6 +4,12 @@ const config = {
4
4
  title: "Print Environment Tool",
5
5
  description: "Returns all environment variables, helpful for debugging MCP server configuration",
6
6
  inputSchema: {},
7
+ annotations: {
8
+ readOnlyHint: true,
9
+ destructiveHint: false,
10
+ idempotentHint: true,
11
+ openWorldHint: false,
12
+ },
7
13
  };
8
14
  /**
9
15
  * Registers the 'get-env' tool.
@@ -15,6 +15,12 @@ const config = {
15
15
  title: "Get Resource Links Tool",
16
16
  description: "Returns up to ten resource links that reference different types of resources",
17
17
  inputSchema: GetResourceLinksSchema,
18
+ annotations: {
19
+ readOnlyHint: true,
20
+ destructiveHint: false,
21
+ idempotentHint: true,
22
+ openWorldHint: false,
23
+ },
18
24
  };
19
25
  /**
20
26
  * Registers the 'get-resource-reference' tool.
@@ -16,6 +16,12 @@ const config = {
16
16
  title: "Get Resource Reference Tool",
17
17
  description: "Returns a resource reference that can be used by MCP clients",
18
18
  inputSchema: GetResourceReferenceSchema,
19
+ annotations: {
20
+ readOnlyHint: true,
21
+ destructiveHint: false,
22
+ idempotentHint: true,
23
+ openWorldHint: false,
24
+ },
19
25
  };
20
26
  /**
21
27
  * Registers the 'get-resource-reference' tool.
@@ -5,6 +5,12 @@ const config = {
5
5
  title: "Get Roots List Tool",
6
6
  description: "Lists the current MCP roots provided by the client. Demonstrates the roots protocol capability even though this server doesn't access files.",
7
7
  inputSchema: {},
8
+ annotations: {
9
+ readOnlyHint: true,
10
+ destructiveHint: false,
11
+ idempotentHint: true,
12
+ openWorldHint: false,
13
+ },
8
14
  };
9
15
  /**
10
16
  * Registers the 'get-roots-list' tool.
@@ -18,6 +18,12 @@ const config = {
18
18
  description: "Returns structured content along with an output schema for client data validation",
19
19
  inputSchema: GetStructuredContentInputSchema,
20
20
  outputSchema: GetStructuredContentOutputSchema,
21
+ annotations: {
22
+ readOnlyHint: true,
23
+ destructiveHint: false,
24
+ idempotentHint: true,
25
+ openWorldHint: false,
26
+ },
21
27
  };
22
28
  /**
23
29
  * Registers the 'get-structured-content' tool.
@@ -10,6 +10,12 @@ const config = {
10
10
  title: "Get Sum Tool",
11
11
  description: "Returns the sum of two numbers",
12
12
  inputSchema: GetSumSchema,
13
+ annotations: {
14
+ readOnlyHint: true,
15
+ destructiveHint: false,
16
+ idempotentHint: true,
17
+ openWorldHint: false,
18
+ },
13
19
  };
14
20
  /**
15
21
  * Registers the 'get-sum' tool.
@@ -6,6 +6,12 @@ const config = {
6
6
  title: "Get Tiny Image Tool",
7
7
  description: "Returns a tiny MCP logo image.",
8
8
  inputSchema: {},
9
+ annotations: {
10
+ readOnlyHint: true,
11
+ destructiveHint: false,
12
+ idempotentHint: true,
13
+ openWorldHint: false,
14
+ },
9
15
  };
10
16
  /**
11
17
  * Registers the "get-tiny-image" tool.
@@ -14,7 +14,6 @@ const GZIP_ALLOWED_DOMAINS = (process.env.GZIP_ALLOWED_DOMAINS ?? "")
14
14
  const GZipFileAsResourceSchema = z.object({
15
15
  name: z.string().describe("Name of the output file").default("README.md.gz"),
16
16
  data: z
17
- .string()
18
17
  .url()
19
18
  .describe("URL or data URI of the file content to compress")
20
19
  .default("https://raw.githubusercontent.com/modelcontextprotocol/servers/refs/heads/main/README.md"),
@@ -29,6 +28,12 @@ const config = {
29
28
  title: "GZip File as Resource Tool",
30
29
  description: "Compresses a single file using gzip compression. Depending upon the selected output type, returns either the compressed data as a gzipped resource or a resource link, allowing it to be downloaded in a subsequent request during the current session.",
31
30
  inputSchema: GZipFileAsResourceSchema,
31
+ annotations: {
32
+ readOnlyHint: false,
33
+ destructiveHint: false,
34
+ idempotentHint: true,
35
+ openWorldHint: true,
36
+ },
32
37
  };
33
38
  /**
34
39
  * Registers the `gzip-file-as-resource` tool.
@@ -16,6 +16,7 @@ import { registerTriggerSamplingRequestTool } from "./trigger-sampling-request.j
16
16
  import { registerTriggerSamplingRequestAsyncTool } from "./trigger-sampling-request-async.js";
17
17
  import { registerTriggerElicitationRequestAsyncTool } from "./trigger-elicitation-request-async.js";
18
18
  import { registerSimulateResearchQueryTool } from "./simulate-research-query.js";
19
+ import { registerTriggerUrlElicitationTool } from "./trigger-url-elicitation.js";
19
20
  /**
20
21
  * Register the tools with the MCP server.
21
22
  * @param server
@@ -41,6 +42,7 @@ export const registerTools = (server) => {
41
42
  export const registerConditionalTools = (server) => {
42
43
  registerGetRootsListTool(server);
43
44
  registerTriggerElicitationRequestTool(server);
45
+ registerTriggerUrlElicitationTool(server);
44
46
  registerTriggerSamplingRequestTool(server);
45
47
  // Task-based research tool (uses experimental tasks API)
46
48
  registerSimulateResearchQueryTool(server);
@@ -22,11 +22,10 @@ const researchStates = new Map();
22
22
  /**
23
23
  * Runs the background research process.
24
24
  * Updates task status as it progresses through stages.
25
- * If clarification is needed, attempts elicitation via sendRequest.
26
- *
27
- * Note: Elicitation only works on STDIO transport. On HTTP transport,
28
- * sendRequest will fail and the task will use a default interpretation.
29
- * Full HTTP support requires SDK PR #1210's elicitInputStream API.
25
+ * If clarification is needed, sends elicitation via sendRequest with relatedTask,
26
+ * which queues the request in the task message queue. The SDK delivers it through
27
+ * the tasks/result stream when the client calls tasks/result (per spec input_required flow).
28
+ * This works on all transports (STDIO, SSE, Streamable HTTP).
30
29
  */
31
30
  async function runResearchProcess(taskId, args, taskStore,
32
31
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -47,7 +46,7 @@ sendRequest) {
47
46
  // Update status to show we're requesting input (spec SHOULD)
48
47
  await taskStore.updateTaskStatus(taskId, "input_required", `Found multiple interpretations for "${state.topic}". Requesting clarification...`);
49
48
  try {
50
- // Try elicitation via sendRequest (works on STDIO, fails on HTTP)
49
+ // relatedTask queues elicitation via task message queue delivered through tasks/result on all transports
51
50
  const elicitResult = await sendRequest({
52
51
  method: "elicitation/create",
53
52
  params: {
@@ -65,7 +64,7 @@ sendRequest) {
65
64
  required: ["interpretation"],
66
65
  },
67
66
  },
68
- }, ElicitResultSchema);
67
+ }, ElicitResultSchema, { relatedTask: { taskId } });
69
68
  // Process elicitation response
70
69
  if (elicitResult.action === "accept" && elicitResult.content) {
71
70
  state.clarification =
@@ -80,11 +79,9 @@ sendRequest) {
80
79
  }
81
80
  }
82
81
  catch (error) {
83
- // Elicitation failed (likely HTTP transport without streaming support)
84
- // Use default interpretation and continue - task should still complete
85
- console.warn(`Elicitation failed for task ${taskId} (HTTP transport?):`, error instanceof Error ? error.message : String(error));
86
- state.clarification =
87
- "technical (default - elicitation unavailable on HTTP)";
82
+ // Elicitation failed - use default interpretation and continue
83
+ console.warn(`Elicitation failed for task ${taskId}:`, error instanceof Error ? error.message : String(error));
84
+ state.clarification = "technical (default - elicitation unavailable)";
88
85
  }
89
86
  // Resume with working status (spec SHOULD)
90
87
  await taskStore.updateTaskStatus(taskId, "working", `Continuing with interpretation: "${state.clarification}"...`);
@@ -132,12 +129,8 @@ ${state.clarification
132
129
  ? `**Elicitation Flow:**
133
130
  When the query was ambiguous, the server sent an \`elicitation/create\` request
134
131
  to the client. The task status changed to \`input_required\` while awaiting user input.
135
- ${state.clarification.includes("unavailable on HTTP")
136
- ? `
137
- **Note:** Elicitation was skipped because this server is running over HTTP transport.
138
- The current SDK's \`sendRequest\` only works over STDIO. Full HTTP elicitation support
139
- requires SDK PR #1210's streaming \`elicitInputStream\` API.
140
- `
132
+ ${state.clarification.includes("unavailable")
133
+ ? `**Note:** Elicitation failed and a default interpretation was used.`
141
134
  : `After receiving clarification ("${state.clarification}"), the task resumed processing and completed.`}
142
135
  `
143
136
  : ""}
@@ -146,7 +139,7 @@ requires SDK PR #1210's streaming \`elicitInputStream\` API.
146
139
  - \`statusMessage\` provides human-readable progress updates
147
140
  - Tasks have TTL (time-to-live) for automatic cleanup
148
141
  - \`pollInterval\` suggests how often to check status
149
- - Elicitation requests can be sent directly during task execution
142
+ - Elicitation requests use \`relatedTask\` to queue via tasks/result (works on all transports)
150
143
 
151
144
  *This is a simulated research report from the Everything MCP Server.*
152
145
  `;
@@ -179,6 +172,12 @@ export const registerSimulateResearchQueryTool = (server) => {
179
172
  "If 'ambiguous' is true and client supports elicitation, sends an elicitation request for clarification.",
180
173
  inputSchema: SimulateResearchQuerySchema,
181
174
  execution: { taskSupport: "required" },
175
+ annotations: {
176
+ readOnlyHint: false,
177
+ destructiveHint: false,
178
+ idempotentHint: false,
179
+ openWorldHint: false,
180
+ },
182
181
  }, {
183
182
  /**
184
183
  * Creates a new research task and starts background processing.
@@ -199,7 +198,7 @@ export const registerSimulateResearchQueryTool = (server) => {
199
198
  };
200
199
  researchStates.set(task.taskId, state);
201
200
  // Start background research (don't await - runs asynchronously)
202
- // Pass sendRequest for elicitation (works on STDIO, gracefully degrades on HTTP)
201
+ // Pass sendRequest for elicitation (queued via task message queue, works on all transports)
203
202
  runResearchProcess(task.taskId, validatedArgs, extra.taskStore, extra.sendRequest).catch((error) => {
204
203
  console.error(`Research task ${task.taskId} failed:`, error);
205
204
  extra.taskStore
@@ -5,6 +5,12 @@ const config = {
5
5
  title: "Toggle Simulated Logging",
6
6
  description: "Toggles simulated, random-leveled logging on or off.",
7
7
  inputSchema: {},
8
+ annotations: {
9
+ readOnlyHint: false,
10
+ destructiveHint: false,
11
+ idempotentHint: false,
12
+ openWorldHint: false,
13
+ },
8
14
  };
9
15
  // Track enabled clients by session id
10
16
  const clients = new Set();
@@ -5,6 +5,12 @@ const config = {
5
5
  title: "Toggle Subscriber Updates",
6
6
  description: "Toggles simulated resource subscription updates on or off.",
7
7
  inputSchema: {},
8
+ annotations: {
9
+ readOnlyHint: false,
10
+ destructiveHint: false,
11
+ idempotentHint: false,
12
+ openWorldHint: false,
13
+ },
8
14
  };
9
15
  // Track enabled clients by session id
10
16
  const clients = new Set();
@@ -7,6 +7,12 @@ const config = {
7
7
  "Demonstrates bidirectional MCP tasks where the server sends an elicitation request and " +
8
8
  "the client handles user input asynchronously, allowing the server to poll for completion.",
9
9
  inputSchema: {},
10
+ annotations: {
11
+ readOnlyHint: false,
12
+ destructiveHint: false,
13
+ idempotentHint: false,
14
+ openWorldHint: false,
15
+ },
10
16
  };
11
17
  // Poll interval in milliseconds
12
18
  const POLL_INTERVAL = 1000;
@@ -117,12 +123,10 @@ export const registerTriggerElicitationRequestAsyncTool = (server) => {
117
123
  const pollResult = await extra.sendRequest({
118
124
  method: "tasks/get",
119
125
  params: { taskId },
120
- }, z
121
- .object({
126
+ }, z.looseObject({
122
127
  status: z.string(),
123
128
  statusMessage: z.string().optional(),
124
- })
125
- .passthrough());
129
+ }));
126
130
  taskStatus = pollResult.status;
127
131
  taskStatusMessage = pollResult.statusMessage;
128
132
  // Only log status changes or every 10 polls to avoid spam
@@ -5,6 +5,12 @@ const config = {
5
5
  title: "Trigger Elicitation Request Tool",
6
6
  description: "Trigger a Request from the Server for User Elicitation",
7
7
  inputSchema: {},
8
+ annotations: {
9
+ readOnlyHint: false,
10
+ destructiveHint: false,
11
+ idempotentHint: false,
12
+ openWorldHint: false,
13
+ },
8
14
  };
9
15
  /**
10
16
  * Registers the 'trigger-elicitation-request' tool.
@@ -13,6 +13,12 @@ const config = {
13
13
  title: "Trigger Long Running Operation Tool",
14
14
  description: "Demonstrates a long running operation with progress updates.",
15
15
  inputSchema: TriggerLongRunningOperationSchema,
16
+ annotations: {
17
+ readOnlyHint: true,
18
+ destructiveHint: false,
19
+ idempotentHint: true,
20
+ openWorldHint: false,
21
+ },
16
22
  };
17
23
  /**
18
24
  * Registers the 'trigger-tong-running-operation' tool.
@@ -15,6 +15,12 @@ const config = {
15
15
  "Demonstrates bidirectional MCP tasks where the server sends a request and the client " +
16
16
  "executes it asynchronously, allowing the server to poll for progress and results.",
17
17
  inputSchema: TriggerSamplingRequestAsyncSchema,
18
+ annotations: {
19
+ readOnlyHint: false,
20
+ destructiveHint: false,
21
+ idempotentHint: false,
22
+ openWorldHint: true,
23
+ },
18
24
  };
19
25
  // Poll interval in milliseconds
20
26
  const POLL_INTERVAL = 1000;
@@ -117,12 +123,10 @@ export const registerTriggerSamplingRequestAsyncTool = (server) => {
117
123
  const pollResult = await extra.sendRequest({
118
124
  method: "tasks/get",
119
125
  params: { taskId },
120
- }, z
121
- .object({
126
+ }, z.looseObject({
122
127
  status: z.string(),
123
128
  statusMessage: z.string().optional(),
124
- })
125
- .passthrough());
129
+ }));
126
130
  taskStatus = pollResult.status;
127
131
  taskStatusMessage = pollResult.statusMessage;
128
132
  statusMessages.push(`Poll ${attempts}: ${taskStatus}${taskStatusMessage ? ` - ${taskStatusMessage}` : ""}`);
@@ -14,6 +14,12 @@ const config = {
14
14
  title: "Trigger Sampling Request Tool",
15
15
  description: "Trigger a Request from the Server for LLM Sampling",
16
16
  inputSchema: TriggerSamplingRequestSchema,
17
+ annotations: {
18
+ readOnlyHint: false,
19
+ destructiveHint: false,
20
+ idempotentHint: false,
21
+ openWorldHint: true,
22
+ },
17
23
  };
18
24
  /**
19
25
  * Registers the 'trigger-sampling-request' tool.