@workday/canvas-kit-mcp 14.1.10 → 14.1.18

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.
package/dist/index.js CHANGED
@@ -6796,7 +6796,7 @@ import { fileURLToPath } from "node:url";
6796
6796
  // package.json
6797
6797
  var package_default = {
6798
6798
  name: "@workday/canvas-kit-mcp",
6799
- version: "14.1.10",
6799
+ version: "14.1.18",
6800
6800
  description: "MCP package for Canvas Kit",
6801
6801
  author: "Workday, Inc. (https://www.workday.com)",
6802
6802
  license: "Apache-2.0",
@@ -6804,7 +6804,7 @@ var package_default = {
6804
6804
  sideEffects: false,
6805
6805
  repository: {
6806
6806
  type: "git",
6807
- url: "https://github.com/workday/canvas-kit.git",
6807
+ url: "https://github.com/Workday/canvas-kit.git",
6808
6808
  directory: "modules/mcp"
6809
6809
  },
6810
6810
  bin: {
@@ -6842,7 +6842,7 @@ var package_default = {
6842
6842
  "@modelcontextprotocol/sdk": "^1.20.2"
6843
6843
  },
6844
6844
  devDependencies: {
6845
- "@types/node": "^14.0.0",
6845
+ "@types/node": "^22.0.0",
6846
6846
  esbuild: "^0.25.11",
6847
6847
  mkdirp: "^1.0.3",
6848
6848
  rimraf: "^5.0.0",
@@ -10907,38 +10907,42 @@ var NEVER = INVALID;
10907
10907
  var LATEST_PROTOCOL_VERSION = "2025-06-18";
10908
10908
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-03-26", "2024-11-05", "2024-10-07"];
10909
10909
  var JSONRPC_VERSION = "2.0";
10910
+ var AssertObjectSchema = external_exports.custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
10910
10911
  var ProgressTokenSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
10911
10912
  var CursorSchema = external_exports.string();
10912
10913
  var RequestMetaSchema = external_exports.object({
10913
10914
  /**
10914
10915
  * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
10915
10916
  */
10916
- progressToken: external_exports.optional(ProgressTokenSchema)
10917
+ progressToken: ProgressTokenSchema.optional()
10917
10918
  }).passthrough();
10918
10919
  var BaseRequestParamsSchema = external_exports.object({
10919
- _meta: external_exports.optional(RequestMetaSchema)
10920
- }).passthrough();
10920
+ /**
10921
+ * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
10922
+ */
10923
+ _meta: RequestMetaSchema.optional()
10924
+ });
10921
10925
  var RequestSchema = external_exports.object({
10922
10926
  method: external_exports.string(),
10923
- params: external_exports.optional(BaseRequestParamsSchema)
10927
+ params: BaseRequestParamsSchema.passthrough().optional()
10924
10928
  });
10925
- var BaseNotificationParamsSchema = external_exports.object({
10929
+ var NotificationsParamsSchema = external_exports.object({
10926
10930
  /**
10927
10931
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
10928
10932
  * for notes on _meta usage.
10929
10933
  */
10930
- _meta: external_exports.optional(external_exports.object({}).passthrough())
10931
- }).passthrough();
10934
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10935
+ });
10932
10936
  var NotificationSchema = external_exports.object({
10933
10937
  method: external_exports.string(),
10934
- params: external_exports.optional(BaseNotificationParamsSchema)
10938
+ params: NotificationsParamsSchema.passthrough().optional()
10935
10939
  });
10936
10940
  var ResultSchema = external_exports.object({
10937
10941
  /**
10938
10942
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
10939
10943
  * for notes on _meta usage.
10940
10944
  */
10941
- _meta: external_exports.optional(external_exports.object({}).passthrough())
10945
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10942
10946
  }).passthrough();
10943
10947
  var RequestIdSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
10944
10948
  var JSONRPCRequestSchema = external_exports.object({
@@ -10987,20 +10991,21 @@ var JSONRPCErrorSchema = external_exports.object({
10987
10991
  var isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
10988
10992
  var JSONRPCMessageSchema = external_exports.union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
10989
10993
  var EmptyResultSchema = ResultSchema.strict();
10994
+ var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
10995
+ /**
10996
+ * The ID of the request to cancel.
10997
+ *
10998
+ * This MUST correspond to the ID of a request previously issued in the same direction.
10999
+ */
11000
+ requestId: RequestIdSchema,
11001
+ /**
11002
+ * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
11003
+ */
11004
+ reason: external_exports.string().optional()
11005
+ });
10990
11006
  var CancelledNotificationSchema = NotificationSchema.extend({
10991
11007
  method: external_exports.literal("notifications/cancelled"),
10992
- params: BaseNotificationParamsSchema.extend({
10993
- /**
10994
- * The ID of the request to cancel.
10995
- *
10996
- * This MUST correspond to the ID of a request previously issued in the same direction.
10997
- */
10998
- requestId: RequestIdSchema,
10999
- /**
11000
- * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
11001
- */
11002
- reason: external_exports.string().optional()
11003
- })
11008
+ params: CancelledNotificationParamsSchema
11004
11009
  });
11005
11010
  var IconSchema = external_exports.object({
11006
11011
  /**
@@ -11010,15 +11015,15 @@ var IconSchema = external_exports.object({
11010
11015
  /**
11011
11016
  * Optional MIME type for the icon.
11012
11017
  */
11013
- mimeType: external_exports.optional(external_exports.string()),
11018
+ mimeType: external_exports.string().optional(),
11014
11019
  /**
11015
11020
  * Optional array of strings that specify sizes at which the icon can be used.
11016
11021
  * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
11017
11022
  *
11018
11023
  * If not provided, the client should assume that the icon can be used at any size.
11019
11024
  */
11020
- sizes: external_exports.optional(external_exports.array(external_exports.string()))
11021
- }).passthrough();
11025
+ sizes: external_exports.array(external_exports.string()).optional()
11026
+ });
11022
11027
  var IconsSchema = external_exports.object({
11023
11028
  /**
11024
11029
  * Optional set of sized icons that the client can display in a user interface.
@@ -11032,7 +11037,7 @@ var IconsSchema = external_exports.object({
11032
11037
  * - `image/webp` - WebP images (modern, efficient format)
11033
11038
  */
11034
11039
  icons: external_exports.array(IconSchema).optional()
11035
- }).passthrough();
11040
+ });
11036
11041
  var BaseMetadataSchema = external_exports.object({
11037
11042
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
11038
11043
  name: external_exports.string(),
@@ -11044,62 +11049,68 @@ var BaseMetadataSchema = external_exports.object({
11044
11049
  * where `annotations.title` should be given precedence over using `name`,
11045
11050
  * if present).
11046
11051
  */
11047
- title: external_exports.optional(external_exports.string())
11048
- }).passthrough();
11052
+ title: external_exports.string().optional()
11053
+ });
11049
11054
  var ImplementationSchema = BaseMetadataSchema.extend({
11050
11055
  version: external_exports.string(),
11051
11056
  /**
11052
11057
  * An optional URL of the website for this implementation.
11053
11058
  */
11054
- websiteUrl: external_exports.optional(external_exports.string())
11059
+ websiteUrl: external_exports.string().optional()
11055
11060
  }).merge(IconsSchema);
11056
11061
  var ClientCapabilitiesSchema = external_exports.object({
11057
11062
  /**
11058
11063
  * Experimental, non-standard capabilities that the client supports.
11059
11064
  */
11060
- experimental: external_exports.optional(external_exports.object({}).passthrough()),
11065
+ experimental: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
11061
11066
  /**
11062
11067
  * Present if the client supports sampling from an LLM.
11063
11068
  */
11064
- sampling: external_exports.optional(external_exports.object({}).passthrough()),
11069
+ sampling: AssertObjectSchema.optional(),
11065
11070
  /**
11066
11071
  * Present if the client supports eliciting user input.
11067
11072
  */
11068
- elicitation: external_exports.optional(external_exports.object({}).passthrough()),
11073
+ elicitation: external_exports.intersection(external_exports.object({
11074
+ /**
11075
+ * Whether the client should apply defaults to the user input.
11076
+ */
11077
+ applyDefaults: external_exports.boolean().optional()
11078
+ }).optional(), external_exports.record(external_exports.string(), external_exports.unknown()).optional()),
11069
11079
  /**
11070
11080
  * Present if the client supports listing roots.
11071
11081
  */
11072
- roots: external_exports.optional(external_exports.object({
11082
+ roots: external_exports.object({
11073
11083
  /**
11074
11084
  * Whether the client supports issuing notifications for changes to the roots list.
11075
11085
  */
11076
- listChanged: external_exports.optional(external_exports.boolean())
11077
- }).passthrough())
11078
- }).passthrough();
11086
+ listChanged: external_exports.boolean().optional()
11087
+ }).optional()
11088
+ });
11089
+ var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
11090
+ /**
11091
+ * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
11092
+ */
11093
+ protocolVersion: external_exports.string(),
11094
+ capabilities: ClientCapabilitiesSchema,
11095
+ clientInfo: ImplementationSchema
11096
+ });
11079
11097
  var InitializeRequestSchema = RequestSchema.extend({
11080
11098
  method: external_exports.literal("initialize"),
11081
- params: BaseRequestParamsSchema.extend({
11082
- /**
11083
- * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
11084
- */
11085
- protocolVersion: external_exports.string(),
11086
- capabilities: ClientCapabilitiesSchema,
11087
- clientInfo: ImplementationSchema
11088
- })
11099
+ params: InitializeRequestParamsSchema
11089
11100
  });
11090
11101
  var ServerCapabilitiesSchema = external_exports.object({
11091
11102
  /**
11092
11103
  * Experimental, non-standard capabilities that the server supports.
11093
11104
  */
11094
- experimental: external_exports.optional(external_exports.object({}).passthrough()),
11105
+ experimental: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
11095
11106
  /**
11096
11107
  * Present if the server supports sending log messages to the client.
11097
11108
  */
11098
- logging: external_exports.optional(external_exports.object({}).passthrough()),
11109
+ logging: AssertObjectSchema.optional(),
11099
11110
  /**
11100
11111
  * Present if the server supports sending completions to the client.
11101
11112
  */
11102
- completions: external_exports.optional(external_exports.object({}).passthrough()),
11113
+ completions: AssertObjectSchema.optional(),
11103
11114
  /**
11104
11115
  * Present if the server offers any prompt templates.
11105
11116
  */
@@ -11108,30 +11119,30 @@ var ServerCapabilitiesSchema = external_exports.object({
11108
11119
  * Whether this server supports issuing notifications for changes to the prompt list.
11109
11120
  */
11110
11121
  listChanged: external_exports.optional(external_exports.boolean())
11111
- }).passthrough()),
11122
+ })),
11112
11123
  /**
11113
11124
  * Present if the server offers any resources to read.
11114
11125
  */
11115
- resources: external_exports.optional(external_exports.object({
11126
+ resources: external_exports.object({
11116
11127
  /**
11117
11128
  * Whether this server supports clients subscribing to resource updates.
11118
11129
  */
11119
- subscribe: external_exports.optional(external_exports.boolean()),
11130
+ subscribe: external_exports.boolean().optional(),
11120
11131
  /**
11121
11132
  * Whether this server supports issuing notifications for changes to the resource list.
11122
11133
  */
11123
- listChanged: external_exports.optional(external_exports.boolean())
11124
- }).passthrough()),
11134
+ listChanged: external_exports.boolean().optional()
11135
+ }).optional(),
11125
11136
  /**
11126
11137
  * Present if the server offers any tools to call.
11127
11138
  */
11128
- tools: external_exports.optional(external_exports.object({
11139
+ tools: external_exports.object({
11129
11140
  /**
11130
11141
  * Whether this server supports issuing notifications for changes to the tool list.
11131
11142
  */
11132
- listChanged: external_exports.optional(external_exports.boolean())
11133
- }).passthrough())
11134
- }).passthrough();
11143
+ listChanged: external_exports.boolean().optional()
11144
+ }).optional()
11145
+ });
11135
11146
  var InitializeResultSchema = ResultSchema.extend({
11136
11147
  /**
11137
11148
  * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
@@ -11144,7 +11155,7 @@ var InitializeResultSchema = ResultSchema.extend({
11144
11155
  *
11145
11156
  * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
11146
11157
  */
11147
- instructions: external_exports.optional(external_exports.string())
11158
+ instructions: external_exports.string().optional()
11148
11159
  });
11149
11160
  var InitializedNotificationSchema = NotificationSchema.extend({
11150
11161
  method: external_exports.literal("notifications/initialized")
@@ -11165,24 +11176,26 @@ var ProgressSchema = external_exports.object({
11165
11176
  * An optional message describing the current progress.
11166
11177
  */
11167
11178
  message: external_exports.optional(external_exports.string())
11168
- }).passthrough();
11179
+ });
11180
+ var ProgressNotificationParamsSchema = NotificationsParamsSchema.merge(ProgressSchema).extend({
11181
+ /**
11182
+ * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
11183
+ */
11184
+ progressToken: ProgressTokenSchema
11185
+ });
11169
11186
  var ProgressNotificationSchema = NotificationSchema.extend({
11170
11187
  method: external_exports.literal("notifications/progress"),
11171
- params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
11172
- /**
11173
- * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
11174
- */
11175
- progressToken: ProgressTokenSchema
11176
- })
11188
+ params: ProgressNotificationParamsSchema
11189
+ });
11190
+ var PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
11191
+ /**
11192
+ * An opaque token representing the current pagination position.
11193
+ * If provided, the server should return results starting after this cursor.
11194
+ */
11195
+ cursor: CursorSchema.optional()
11177
11196
  });
11178
11197
  var PaginatedRequestSchema = RequestSchema.extend({
11179
- params: BaseRequestParamsSchema.extend({
11180
- /**
11181
- * An opaque token representing the current pagination position.
11182
- * If provided, the server should return results starting after this cursor.
11183
- */
11184
- cursor: external_exports.optional(CursorSchema)
11185
- }).optional()
11198
+ params: PaginatedRequestParamsSchema.optional()
11186
11199
  });
11187
11200
  var PaginatedResultSchema = ResultSchema.extend({
11188
11201
  /**
@@ -11204,8 +11217,8 @@ var ResourceContentsSchema = external_exports.object({
11204
11217
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11205
11218
  * for notes on _meta usage.
11206
11219
  */
11207
- _meta: external_exports.optional(external_exports.object({}).passthrough())
11208
- }).passthrough();
11220
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11221
+ });
11209
11222
  var TextResourceContentsSchema = ResourceContentsSchema.extend({
11210
11223
  /**
11211
11224
  * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
@@ -11280,14 +11293,18 @@ var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
11280
11293
  var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
11281
11294
  resourceTemplates: external_exports.array(ResourceTemplateSchema)
11282
11295
  });
11296
+ var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
11297
+ /**
11298
+ * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
11299
+ *
11300
+ * @format uri
11301
+ */
11302
+ uri: external_exports.string()
11303
+ });
11304
+ var ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
11283
11305
  var ReadResourceRequestSchema = RequestSchema.extend({
11284
11306
  method: external_exports.literal("resources/read"),
11285
- params: BaseRequestParamsSchema.extend({
11286
- /**
11287
- * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
11288
- */
11289
- uri: external_exports.string()
11290
- })
11307
+ params: ReadResourceRequestParamsSchema
11291
11308
  });
11292
11309
  var ReadResourceResultSchema = ResultSchema.extend({
11293
11310
  contents: external_exports.array(external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
@@ -11295,32 +11312,25 @@ var ReadResourceResultSchema = ResultSchema.extend({
11295
11312
  var ResourceListChangedNotificationSchema = NotificationSchema.extend({
11296
11313
  method: external_exports.literal("notifications/resources/list_changed")
11297
11314
  });
11315
+ var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
11298
11316
  var SubscribeRequestSchema = RequestSchema.extend({
11299
11317
  method: external_exports.literal("resources/subscribe"),
11300
- params: BaseRequestParamsSchema.extend({
11301
- /**
11302
- * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
11303
- */
11304
- uri: external_exports.string()
11305
- })
11318
+ params: SubscribeRequestParamsSchema
11306
11319
  });
11320
+ var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
11307
11321
  var UnsubscribeRequestSchema = RequestSchema.extend({
11308
11322
  method: external_exports.literal("resources/unsubscribe"),
11309
- params: BaseRequestParamsSchema.extend({
11310
- /**
11311
- * The URI of the resource to unsubscribe from.
11312
- */
11313
- uri: external_exports.string()
11314
- })
11323
+ params: UnsubscribeRequestParamsSchema
11324
+ });
11325
+ var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
11326
+ /**
11327
+ * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
11328
+ */
11329
+ uri: external_exports.string()
11315
11330
  });
11316
11331
  var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
11317
11332
  method: external_exports.literal("notifications/resources/updated"),
11318
- params: BaseNotificationParamsSchema.extend({
11319
- /**
11320
- * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
11321
- */
11322
- uri: external_exports.string()
11323
- })
11333
+ params: ResourceUpdatedNotificationParamsSchema
11324
11334
  });
11325
11335
  var PromptArgumentSchema = external_exports.object({
11326
11336
  /**
@@ -11335,7 +11345,7 @@ var PromptArgumentSchema = external_exports.object({
11335
11345
  * Whether this argument must be provided.
11336
11346
  */
11337
11347
  required: external_exports.optional(external_exports.boolean())
11338
- }).passthrough();
11348
+ });
11339
11349
  var PromptSchema = BaseMetadataSchema.extend({
11340
11350
  /**
11341
11351
  * An optional description of what this prompt provides
@@ -11357,18 +11367,19 @@ var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
11357
11367
  var ListPromptsResultSchema = PaginatedResultSchema.extend({
11358
11368
  prompts: external_exports.array(PromptSchema)
11359
11369
  });
11370
+ var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
11371
+ /**
11372
+ * The name of the prompt or prompt template.
11373
+ */
11374
+ name: external_exports.string(),
11375
+ /**
11376
+ * Arguments to use for templating the prompt.
11377
+ */
11378
+ arguments: external_exports.record(external_exports.string(), external_exports.string()).optional()
11379
+ });
11360
11380
  var GetPromptRequestSchema = RequestSchema.extend({
11361
11381
  method: external_exports.literal("prompts/get"),
11362
- params: BaseRequestParamsSchema.extend({
11363
- /**
11364
- * The name of the prompt or prompt template.
11365
- */
11366
- name: external_exports.string(),
11367
- /**
11368
- * Arguments to use for templating the prompt.
11369
- */
11370
- arguments: external_exports.optional(external_exports.record(external_exports.string()))
11371
- })
11382
+ params: GetPromptRequestParamsSchema
11372
11383
  });
11373
11384
  var TextContentSchema = external_exports.object({
11374
11385
  type: external_exports.literal("text"),
@@ -11380,8 +11391,8 @@ var TextContentSchema = external_exports.object({
11380
11391
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11381
11392
  * for notes on _meta usage.
11382
11393
  */
11383
- _meta: external_exports.optional(external_exports.object({}).passthrough())
11384
- }).passthrough();
11394
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11395
+ });
11385
11396
  var ImageContentSchema = external_exports.object({
11386
11397
  type: external_exports.literal("image"),
11387
11398
  /**
@@ -11396,8 +11407,8 @@ var ImageContentSchema = external_exports.object({
11396
11407
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11397
11408
  * for notes on _meta usage.
11398
11409
  */
11399
- _meta: external_exports.optional(external_exports.object({}).passthrough())
11400
- }).passthrough();
11410
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11411
+ });
11401
11412
  var AudioContentSchema = external_exports.object({
11402
11413
  type: external_exports.literal("audio"),
11403
11414
  /**
@@ -11412,8 +11423,8 @@ var AudioContentSchema = external_exports.object({
11412
11423
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11413
11424
  * for notes on _meta usage.
11414
11425
  */
11415
- _meta: external_exports.optional(external_exports.object({}).passthrough())
11416
- }).passthrough();
11426
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11427
+ });
11417
11428
  var EmbeddedResourceSchema = external_exports.object({
11418
11429
  type: external_exports.literal("resource"),
11419
11430
  resource: external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
@@ -11421,8 +11432,8 @@ var EmbeddedResourceSchema = external_exports.object({
11421
11432
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11422
11433
  * for notes on _meta usage.
11423
11434
  */
11424
- _meta: external_exports.optional(external_exports.object({}).passthrough())
11425
- }).passthrough();
11435
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11436
+ });
11426
11437
  var ResourceLinkSchema = ResourceSchema.extend({
11427
11438
  type: external_exports.literal("resource_link")
11428
11439
  });
@@ -11436,7 +11447,7 @@ var ContentBlockSchema = external_exports.union([
11436
11447
  var PromptMessageSchema = external_exports.object({
11437
11448
  role: external_exports.enum(["user", "assistant"]),
11438
11449
  content: ContentBlockSchema
11439
- }).passthrough();
11450
+ });
11440
11451
  var GetPromptResultSchema = ResultSchema.extend({
11441
11452
  /**
11442
11453
  * An optional description for the prompt.
@@ -11451,13 +11462,13 @@ var ToolAnnotationsSchema = external_exports.object({
11451
11462
  /**
11452
11463
  * A human-readable title for the tool.
11453
11464
  */
11454
- title: external_exports.optional(external_exports.string()),
11465
+ title: external_exports.string().optional(),
11455
11466
  /**
11456
11467
  * If true, the tool does not modify its environment.
11457
11468
  *
11458
11469
  * Default: false
11459
11470
  */
11460
- readOnlyHint: external_exports.optional(external_exports.boolean()),
11471
+ readOnlyHint: external_exports.boolean().optional(),
11461
11472
  /**
11462
11473
  * If true, the tool may perform destructive updates to its environment.
11463
11474
  * If false, the tool performs only additive updates.
@@ -11466,7 +11477,7 @@ var ToolAnnotationsSchema = external_exports.object({
11466
11477
  *
11467
11478
  * Default: true
11468
11479
  */
11469
- destructiveHint: external_exports.optional(external_exports.boolean()),
11480
+ destructiveHint: external_exports.boolean().optional(),
11470
11481
  /**
11471
11482
  * If true, calling the tool repeatedly with the same arguments
11472
11483
  * will have no additional effect on the its environment.
@@ -11475,7 +11486,7 @@ var ToolAnnotationsSchema = external_exports.object({
11475
11486
  *
11476
11487
  * Default: false
11477
11488
  */
11478
- idempotentHint: external_exports.optional(external_exports.boolean()),
11489
+ idempotentHint: external_exports.boolean().optional(),
11479
11490
  /**
11480
11491
  * If true, this tool may interact with an "open world" of external
11481
11492
  * entities. If false, the tool's domain of interaction is closed.
@@ -11484,30 +11495,34 @@ var ToolAnnotationsSchema = external_exports.object({
11484
11495
  *
11485
11496
  * Default: true
11486
11497
  */
11487
- openWorldHint: external_exports.optional(external_exports.boolean())
11488
- }).passthrough();
11498
+ openWorldHint: external_exports.boolean().optional()
11499
+ });
11489
11500
  var ToolSchema = BaseMetadataSchema.extend({
11490
11501
  /**
11491
11502
  * A human-readable description of the tool.
11492
11503
  */
11493
- description: external_exports.optional(external_exports.string()),
11504
+ description: external_exports.string().optional(),
11494
11505
  /**
11495
11506
  * A JSON Schema object defining the expected parameters for the tool.
11496
11507
  */
11497
11508
  inputSchema: external_exports.object({
11498
11509
  type: external_exports.literal("object"),
11499
- properties: external_exports.optional(external_exports.object({}).passthrough()),
11510
+ properties: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
11500
11511
  required: external_exports.optional(external_exports.array(external_exports.string()))
11501
- }).passthrough(),
11512
+ }),
11502
11513
  /**
11503
11514
  * An optional JSON Schema object defining the structure of the tool's output returned in
11504
11515
  * the structuredContent field of a CallToolResult.
11505
11516
  */
11506
- outputSchema: external_exports.optional(external_exports.object({
11517
+ outputSchema: external_exports.object({
11507
11518
  type: external_exports.literal("object"),
11508
- properties: external_exports.optional(external_exports.object({}).passthrough()),
11509
- required: external_exports.optional(external_exports.array(external_exports.string()))
11510
- }).passthrough()),
11519
+ properties: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
11520
+ required: external_exports.optional(external_exports.array(external_exports.string())),
11521
+ /**
11522
+ * Not in the MCP specification, but added to support the Ajv validator while removing .passthrough() which previously allowed additionalProperties to be passed through.
11523
+ */
11524
+ additionalProperties: external_exports.optional(external_exports.boolean())
11525
+ }).optional(),
11511
11526
  /**
11512
11527
  * Optional additional tool information.
11513
11528
  */
@@ -11516,7 +11531,7 @@ var ToolSchema = BaseMetadataSchema.extend({
11516
11531
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11517
11532
  * for notes on _meta usage.
11518
11533
  */
11519
- _meta: external_exports.optional(external_exports.object({}).passthrough())
11534
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11520
11535
  }).merge(IconsSchema);
11521
11536
  var ListToolsRequestSchema = PaginatedRequestSchema.extend({
11522
11537
  method: external_exports.literal("tools/list")
@@ -11537,7 +11552,7 @@ var CallToolResultSchema = ResultSchema.extend({
11537
11552
  *
11538
11553
  * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
11539
11554
  */
11540
- structuredContent: external_exports.object({}).passthrough().optional(),
11555
+ structuredContent: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
11541
11556
  /**
11542
11557
  * Whether the tool call ended in an error.
11543
11558
  *
@@ -11557,49 +11572,58 @@ var CallToolResultSchema = ResultSchema.extend({
11557
11572
  var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
11558
11573
  toolResult: external_exports.unknown()
11559
11574
  }));
11575
+ var CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
11576
+ /**
11577
+ * The name of the tool to call.
11578
+ */
11579
+ name: external_exports.string(),
11580
+ /**
11581
+ * Arguments to pass to the tool.
11582
+ */
11583
+ arguments: external_exports.optional(external_exports.record(external_exports.string(), external_exports.unknown()))
11584
+ });
11560
11585
  var CallToolRequestSchema = RequestSchema.extend({
11561
11586
  method: external_exports.literal("tools/call"),
11562
- params: BaseRequestParamsSchema.extend({
11563
- name: external_exports.string(),
11564
- arguments: external_exports.optional(external_exports.record(external_exports.unknown()))
11565
- })
11587
+ params: CallToolRequestParamsSchema
11566
11588
  });
11567
11589
  var ToolListChangedNotificationSchema = NotificationSchema.extend({
11568
11590
  method: external_exports.literal("notifications/tools/list_changed")
11569
11591
  });
11570
11592
  var LoggingLevelSchema = external_exports.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
11593
+ var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
11594
+ /**
11595
+ * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
11596
+ */
11597
+ level: LoggingLevelSchema
11598
+ });
11571
11599
  var SetLevelRequestSchema = RequestSchema.extend({
11572
11600
  method: external_exports.literal("logging/setLevel"),
11573
- params: BaseRequestParamsSchema.extend({
11574
- /**
11575
- * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
11576
- */
11577
- level: LoggingLevelSchema
11578
- })
11601
+ params: SetLevelRequestParamsSchema
11602
+ });
11603
+ var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
11604
+ /**
11605
+ * The severity of this log message.
11606
+ */
11607
+ level: LoggingLevelSchema,
11608
+ /**
11609
+ * An optional name of the logger issuing this message.
11610
+ */
11611
+ logger: external_exports.string().optional(),
11612
+ /**
11613
+ * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
11614
+ */
11615
+ data: external_exports.unknown()
11579
11616
  });
11580
11617
  var LoggingMessageNotificationSchema = NotificationSchema.extend({
11581
11618
  method: external_exports.literal("notifications/message"),
11582
- params: BaseNotificationParamsSchema.extend({
11583
- /**
11584
- * The severity of this log message.
11585
- */
11586
- level: LoggingLevelSchema,
11587
- /**
11588
- * An optional name of the logger issuing this message.
11589
- */
11590
- logger: external_exports.optional(external_exports.string()),
11591
- /**
11592
- * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
11593
- */
11594
- data: external_exports.unknown()
11595
- })
11619
+ params: LoggingMessageNotificationParamsSchema
11596
11620
  });
11597
11621
  var ModelHintSchema = external_exports.object({
11598
11622
  /**
11599
11623
  * A hint for a model name.
11600
11624
  */
11601
11625
  name: external_exports.string().optional()
11602
- }).passthrough();
11626
+ });
11603
11627
  var ModelPreferencesSchema = external_exports.object({
11604
11628
  /**
11605
11629
  * Optional hints to use for model selection.
@@ -11617,38 +11641,41 @@ var ModelPreferencesSchema = external_exports.object({
11617
11641
  * How much to prioritize intelligence and capabilities when selecting a model.
11618
11642
  */
11619
11643
  intelligencePriority: external_exports.optional(external_exports.number().min(0).max(1))
11620
- }).passthrough();
11644
+ });
11621
11645
  var SamplingMessageSchema = external_exports.object({
11622
11646
  role: external_exports.enum(["user", "assistant"]),
11623
11647
  content: external_exports.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
11624
- }).passthrough();
11648
+ });
11649
+ var CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
11650
+ messages: external_exports.array(SamplingMessageSchema),
11651
+ /**
11652
+ * The server's preferences for which model to select. The client MAY modify or omit this request.
11653
+ */
11654
+ modelPreferences: ModelPreferencesSchema.optional(),
11655
+ /**
11656
+ * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
11657
+ */
11658
+ systemPrompt: external_exports.string().optional(),
11659
+ /**
11660
+ * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
11661
+ */
11662
+ includeContext: external_exports.enum(["none", "thisServer", "allServers"]).optional(),
11663
+ temperature: external_exports.number().optional(),
11664
+ /**
11665
+ * The requested maximum number of tokens to sample (to prevent runaway completions).
11666
+ *
11667
+ * The client MAY choose to sample fewer tokens than the requested maximum.
11668
+ */
11669
+ maxTokens: external_exports.number().int(),
11670
+ stopSequences: external_exports.array(external_exports.string()).optional(),
11671
+ /**
11672
+ * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
11673
+ */
11674
+ metadata: AssertObjectSchema.optional()
11675
+ });
11625
11676
  var CreateMessageRequestSchema = RequestSchema.extend({
11626
11677
  method: external_exports.literal("sampling/createMessage"),
11627
- params: BaseRequestParamsSchema.extend({
11628
- messages: external_exports.array(SamplingMessageSchema),
11629
- /**
11630
- * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
11631
- */
11632
- systemPrompt: external_exports.optional(external_exports.string()),
11633
- /**
11634
- * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
11635
- */
11636
- includeContext: external_exports.optional(external_exports.enum(["none", "thisServer", "allServers"])),
11637
- temperature: external_exports.optional(external_exports.number()),
11638
- /**
11639
- * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
11640
- */
11641
- maxTokens: external_exports.number().int(),
11642
- stopSequences: external_exports.optional(external_exports.array(external_exports.string())),
11643
- /**
11644
- * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
11645
- */
11646
- metadata: external_exports.optional(external_exports.object({}).passthrough()),
11647
- /**
11648
- * The server's preferences for which model to select.
11649
- */
11650
- modelPreferences: external_exports.optional(ModelPreferencesSchema)
11651
- })
11678
+ params: CreateMessageRequestParamsSchema
11652
11679
  });
11653
11680
  var CreateMessageResultSchema = ResultSchema.extend({
11654
11681
  /**
@@ -11664,59 +11691,114 @@ var CreateMessageResultSchema = ResultSchema.extend({
11664
11691
  });
11665
11692
  var BooleanSchemaSchema = external_exports.object({
11666
11693
  type: external_exports.literal("boolean"),
11667
- title: external_exports.optional(external_exports.string()),
11668
- description: external_exports.optional(external_exports.string()),
11669
- default: external_exports.optional(external_exports.boolean())
11670
- }).passthrough();
11694
+ title: external_exports.string().optional(),
11695
+ description: external_exports.string().optional(),
11696
+ default: external_exports.boolean().optional()
11697
+ });
11671
11698
  var StringSchemaSchema = external_exports.object({
11672
11699
  type: external_exports.literal("string"),
11673
- title: external_exports.optional(external_exports.string()),
11674
- description: external_exports.optional(external_exports.string()),
11675
- minLength: external_exports.optional(external_exports.number()),
11676
- maxLength: external_exports.optional(external_exports.number()),
11677
- format: external_exports.optional(external_exports.enum(["email", "uri", "date", "date-time"]))
11678
- }).passthrough();
11700
+ title: external_exports.string().optional(),
11701
+ description: external_exports.string().optional(),
11702
+ minLength: external_exports.number().optional(),
11703
+ maxLength: external_exports.number().optional(),
11704
+ format: external_exports.enum(["email", "uri", "date", "date-time"]).optional(),
11705
+ default: external_exports.string().optional()
11706
+ });
11679
11707
  var NumberSchemaSchema = external_exports.object({
11680
11708
  type: external_exports.enum(["number", "integer"]),
11681
- title: external_exports.optional(external_exports.string()),
11682
- description: external_exports.optional(external_exports.string()),
11683
- minimum: external_exports.optional(external_exports.number()),
11684
- maximum: external_exports.optional(external_exports.number())
11685
- }).passthrough();
11686
- var EnumSchemaSchema = external_exports.object({
11709
+ title: external_exports.string().optional(),
11710
+ description: external_exports.string().optional(),
11711
+ minimum: external_exports.number().optional(),
11712
+ maximum: external_exports.number().optional(),
11713
+ default: external_exports.number().optional()
11714
+ });
11715
+ var UntitledSingleSelectEnumSchemaSchema = external_exports.object({
11687
11716
  type: external_exports.literal("string"),
11688
- title: external_exports.optional(external_exports.string()),
11689
- description: external_exports.optional(external_exports.string()),
11717
+ title: external_exports.string().optional(),
11718
+ description: external_exports.string().optional(),
11690
11719
  enum: external_exports.array(external_exports.string()),
11691
- enumNames: external_exports.optional(external_exports.array(external_exports.string()))
11692
- }).passthrough();
11693
- var PrimitiveSchemaDefinitionSchema = external_exports.union([BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema]);
11720
+ default: external_exports.string().optional()
11721
+ });
11722
+ var TitledSingleSelectEnumSchemaSchema = external_exports.object({
11723
+ type: external_exports.literal("string"),
11724
+ title: external_exports.string().optional(),
11725
+ description: external_exports.string().optional(),
11726
+ oneOf: external_exports.array(external_exports.object({
11727
+ const: external_exports.string(),
11728
+ title: external_exports.string()
11729
+ })),
11730
+ default: external_exports.string().optional()
11731
+ });
11732
+ var LegacyTitledEnumSchemaSchema = external_exports.object({
11733
+ type: external_exports.literal("string"),
11734
+ title: external_exports.string().optional(),
11735
+ description: external_exports.string().optional(),
11736
+ enum: external_exports.array(external_exports.string()),
11737
+ enumNames: external_exports.array(external_exports.string()).optional(),
11738
+ default: external_exports.string().optional()
11739
+ });
11740
+ var SingleSelectEnumSchemaSchema = external_exports.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
11741
+ var UntitledMultiSelectEnumSchemaSchema = external_exports.object({
11742
+ type: external_exports.literal("array"),
11743
+ title: external_exports.string().optional(),
11744
+ description: external_exports.string().optional(),
11745
+ minItems: external_exports.number().optional(),
11746
+ maxItems: external_exports.number().optional(),
11747
+ items: external_exports.object({
11748
+ type: external_exports.literal("string"),
11749
+ enum: external_exports.array(external_exports.string())
11750
+ }),
11751
+ default: external_exports.array(external_exports.string()).optional()
11752
+ });
11753
+ var TitledMultiSelectEnumSchemaSchema = external_exports.object({
11754
+ type: external_exports.literal("array"),
11755
+ title: external_exports.string().optional(),
11756
+ description: external_exports.string().optional(),
11757
+ minItems: external_exports.number().optional(),
11758
+ maxItems: external_exports.number().optional(),
11759
+ items: external_exports.object({
11760
+ anyOf: external_exports.array(external_exports.object({
11761
+ const: external_exports.string(),
11762
+ title: external_exports.string()
11763
+ }))
11764
+ }),
11765
+ default: external_exports.array(external_exports.string()).optional()
11766
+ });
11767
+ var MultiSelectEnumSchemaSchema = external_exports.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
11768
+ var EnumSchemaSchema = external_exports.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
11769
+ var PrimitiveSchemaDefinitionSchema = external_exports.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
11770
+ var ElicitRequestParamsSchema = BaseRequestParamsSchema.extend({
11771
+ /**
11772
+ * The message to present to the user.
11773
+ */
11774
+ message: external_exports.string(),
11775
+ /**
11776
+ * A restricted subset of JSON Schema.
11777
+ * Only top-level properties are allowed, without nesting.
11778
+ */
11779
+ requestedSchema: external_exports.object({
11780
+ type: external_exports.literal("object"),
11781
+ properties: external_exports.record(external_exports.string(), PrimitiveSchemaDefinitionSchema),
11782
+ required: external_exports.array(external_exports.string()).optional()
11783
+ })
11784
+ });
11694
11785
  var ElicitRequestSchema = RequestSchema.extend({
11695
11786
  method: external_exports.literal("elicitation/create"),
11696
- params: BaseRequestParamsSchema.extend({
11697
- /**
11698
- * The message to present to the user.
11699
- */
11700
- message: external_exports.string(),
11701
- /**
11702
- * The schema for the requested user input.
11703
- */
11704
- requestedSchema: external_exports.object({
11705
- type: external_exports.literal("object"),
11706
- properties: external_exports.record(external_exports.string(), PrimitiveSchemaDefinitionSchema),
11707
- required: external_exports.optional(external_exports.array(external_exports.string()))
11708
- }).passthrough()
11709
- })
11787
+ params: ElicitRequestParamsSchema
11710
11788
  });
11711
11789
  var ElicitResultSchema = ResultSchema.extend({
11712
11790
  /**
11713
- * The user's response action.
11791
+ * The user action in response to the elicitation.
11792
+ * - "accept": User submitted the form/confirmed the action
11793
+ * - "decline": User explicitly decline the action
11794
+ * - "cancel": User dismissed without making an explicit choice
11714
11795
  */
11715
11796
  action: external_exports.enum(["accept", "decline", "cancel"]),
11716
11797
  /**
11717
- * The collected user input content (only present if action is "accept").
11798
+ * The submitted form data, only present when action is "accept".
11799
+ * Contains values matching the requested schema.
11718
11800
  */
11719
- content: external_exports.optional(external_exports.record(external_exports.string(), external_exports.unknown()))
11801
+ content: external_exports.record(external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), external_exports.array(external_exports.string())])).optional()
11720
11802
  });
11721
11803
  var ResourceTemplateReferenceSchema = external_exports.object({
11722
11804
  type: external_exports.literal("ref/resource"),
@@ -11724,39 +11806,50 @@ var ResourceTemplateReferenceSchema = external_exports.object({
11724
11806
  * The URI or URI template of the resource.
11725
11807
  */
11726
11808
  uri: external_exports.string()
11727
- }).passthrough();
11809
+ });
11728
11810
  var PromptReferenceSchema = external_exports.object({
11729
11811
  type: external_exports.literal("ref/prompt"),
11730
11812
  /**
11731
11813
  * The name of the prompt or prompt template
11732
11814
  */
11733
11815
  name: external_exports.string()
11734
- }).passthrough();
11735
- var CompleteRequestSchema = RequestSchema.extend({
11736
- method: external_exports.literal("completion/complete"),
11737
- params: BaseRequestParamsSchema.extend({
11738
- ref: external_exports.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
11816
+ });
11817
+ var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
11818
+ ref: external_exports.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
11819
+ /**
11820
+ * The argument's information
11821
+ */
11822
+ argument: external_exports.object({
11739
11823
  /**
11740
- * The argument's information
11824
+ * The name of the argument
11741
11825
  */
11742
- argument: external_exports.object({
11743
- /**
11744
- * The name of the argument
11745
- */
11746
- name: external_exports.string(),
11747
- /**
11748
- * The value of the argument to use for completion matching.
11749
- */
11750
- value: external_exports.string()
11751
- }).passthrough(),
11752
- context: external_exports.optional(external_exports.object({
11753
- /**
11754
- * Previously-resolved variables in a URI template or prompt.
11755
- */
11756
- arguments: external_exports.optional(external_exports.record(external_exports.string(), external_exports.string()))
11757
- }))
11758
- })
11826
+ name: external_exports.string(),
11827
+ /**
11828
+ * The value of the argument to use for completion matching.
11829
+ */
11830
+ value: external_exports.string()
11831
+ }),
11832
+ context: external_exports.object({
11833
+ /**
11834
+ * Previously-resolved variables in a URI template or prompt.
11835
+ */
11836
+ arguments: external_exports.record(external_exports.string(), external_exports.string()).optional()
11837
+ }).optional()
11838
+ });
11839
+ var CompleteRequestSchema = RequestSchema.extend({
11840
+ method: external_exports.literal("completion/complete"),
11841
+ params: CompleteRequestParamsSchema
11759
11842
  });
11843
+ function assertCompleteRequestPrompt(request) {
11844
+ if (request.params.ref.type !== "ref/prompt") {
11845
+ throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
11846
+ }
11847
+ }
11848
+ function assertCompleteRequestResourceTemplate(request) {
11849
+ if (request.params.ref.type !== "ref/resource") {
11850
+ throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);
11851
+ }
11852
+ }
11760
11853
  var CompleteResultSchema = ResultSchema.extend({
11761
11854
  completion: external_exports.object({
11762
11855
  /**
@@ -11781,13 +11874,13 @@ var RootSchema = external_exports.object({
11781
11874
  /**
11782
11875
  * An optional name for the root.
11783
11876
  */
11784
- name: external_exports.optional(external_exports.string()),
11877
+ name: external_exports.string().optional(),
11785
11878
  /**
11786
11879
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11787
11880
  * for notes on _meta usage.
11788
11881
  */
11789
- _meta: external_exports.optional(external_exports.object({}).passthrough())
11790
- }).passthrough();
11882
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11883
+ });
11791
11884
  var ListRootsRequestSchema = RequestSchema.extend({
11792
11885
  method: external_exports.literal("roots/list")
11793
11886
  });
@@ -12220,15 +12313,24 @@ var Protocol = class {
12220
12313
  this._notificationHandlers.delete(method);
12221
12314
  }
12222
12315
  };
12316
+ function isPlainObject(value) {
12317
+ return value !== null && typeof value === "object" && !Array.isArray(value);
12318
+ }
12223
12319
  function mergeCapabilities(base, additional) {
12224
- return Object.entries(additional).reduce((acc, [key, value]) => {
12225
- if (value && typeof value === "object") {
12226
- acc[key] = acc[key] ? { ...acc[key], ...value } : value;
12320
+ const result = { ...base };
12321
+ for (const key in additional) {
12322
+ const k = key;
12323
+ const addValue = additional[k];
12324
+ if (addValue === void 0)
12325
+ continue;
12326
+ const baseValue = result[k];
12327
+ if (isPlainObject(baseValue) && isPlainObject(addValue)) {
12328
+ result[k] = { ...baseValue, ...addValue };
12227
12329
  } else {
12228
- acc[key] = value;
12330
+ result[k] = addValue;
12229
12331
  }
12230
- return acc;
12231
- }, { ...base });
12332
+ }
12333
+ return result;
12232
12334
  }
12233
12335
 
12234
12336
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
@@ -12400,9 +12502,9 @@ var Server = class extends Protocol {
12400
12502
  }
12401
12503
  assertRequestHandlerCapability(method) {
12402
12504
  switch (method) {
12403
- case "sampling/createMessage":
12404
- if (!this._capabilities.sampling) {
12405
- throw new Error(`Server does not support sampling (required for ${method})`);
12505
+ case "completion/complete":
12506
+ if (!this._capabilities.completions) {
12507
+ throw new Error(`Server does not support completions (required for ${method})`);
12406
12508
  }
12407
12509
  break;
12408
12510
  case "logging/setLevel":
@@ -13857,6 +13959,64 @@ function processCreateParams2(params) {
13857
13959
  return { errorMap: customMap, description };
13858
13960
  }
13859
13961
 
13962
+ // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
13963
+ var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
13964
+ function validateToolName(name) {
13965
+ const warnings = [];
13966
+ if (name.length === 0) {
13967
+ return {
13968
+ isValid: false,
13969
+ warnings: ["Tool name cannot be empty"]
13970
+ };
13971
+ }
13972
+ if (name.length > 128) {
13973
+ return {
13974
+ isValid: false,
13975
+ warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]
13976
+ };
13977
+ }
13978
+ if (name.includes(" ")) {
13979
+ warnings.push("Tool name contains spaces, which may cause parsing issues");
13980
+ }
13981
+ if (name.includes(",")) {
13982
+ warnings.push("Tool name contains commas, which may cause parsing issues");
13983
+ }
13984
+ if (name.startsWith("-") || name.endsWith("-")) {
13985
+ warnings.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");
13986
+ }
13987
+ if (name.startsWith(".") || name.endsWith(".")) {
13988
+ warnings.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");
13989
+ }
13990
+ if (!TOOL_NAME_REGEX.test(name)) {
13991
+ const invalidChars = name.split("").filter((char) => !/[A-Za-z0-9._-]/.test(char)).filter((char, index, arr) => arr.indexOf(char) === index);
13992
+ warnings.push(`Tool name contains invalid characters: ${invalidChars.map((c) => `"${c}"`).join(", ")}`, "Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)");
13993
+ return {
13994
+ isValid: false,
13995
+ warnings
13996
+ };
13997
+ }
13998
+ return {
13999
+ isValid: true,
14000
+ warnings
14001
+ };
14002
+ }
14003
+ function issueToolNameWarning(name, warnings) {
14004
+ if (warnings.length > 0) {
14005
+ console.warn(`Tool name validation warning for "${name}":`);
14006
+ for (const warning of warnings) {
14007
+ console.warn(` - ${warning}`);
14008
+ }
14009
+ console.warn("Tool registration will proceed, but this may cause compatibility issues.");
14010
+ console.warn("Consider updating the tool name to conform to the MCP tool naming standard.");
14011
+ console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.");
14012
+ }
14013
+ }
14014
+ function validateAndWarnToolName(name) {
14015
+ const result = validateToolName(name);
14016
+ issueToolNameWarning(name, result.warnings);
14017
+ return result.isValid;
14018
+ }
14019
+
13860
14020
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
13861
14021
  var McpServer = class {
13862
14022
  constructor(serverInfo, options) {
@@ -13983,8 +14143,10 @@ var McpServer = class {
13983
14143
  this.server.setRequestHandler(CompleteRequestSchema, async (request) => {
13984
14144
  switch (request.params.ref.type) {
13985
14145
  case "ref/prompt":
14146
+ assertCompleteRequestPrompt(request);
13986
14147
  return this.handlePromptCompletion(request, request.params.ref);
13987
14148
  case "ref/resource":
14149
+ assertCompleteRequestResourceTemplate(request);
13988
14150
  return this.handleResourceCompletion(request, request.params.ref);
13989
14151
  default:
13990
14152
  throw new McpError(ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`);
@@ -14273,11 +14435,12 @@ var McpServer = class {
14273
14435
  return registeredPrompt;
14274
14436
  }
14275
14437
  _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, _meta, callback) {
14438
+ validateAndWarnToolName(name);
14276
14439
  const registeredTool = {
14277
14440
  title,
14278
14441
  description,
14279
- inputSchema: inputSchema === void 0 ? void 0 : external_exports.object(inputSchema),
14280
- outputSchema: outputSchema === void 0 ? void 0 : external_exports.object(outputSchema),
14442
+ inputSchema: getZodSchemaObject(inputSchema),
14443
+ outputSchema: getZodSchemaObject(outputSchema),
14281
14444
  annotations,
14282
14445
  _meta,
14283
14446
  callback,
@@ -14287,6 +14450,9 @@ var McpServer = class {
14287
14450
  remove: () => registeredTool.update({ name: null }),
14288
14451
  update: (updates) => {
14289
14452
  if (typeof updates.name !== "undefined" && updates.name !== name) {
14453
+ if (typeof updates.name === "string") {
14454
+ validateAndWarnToolName(updates.name);
14455
+ }
14290
14456
  delete this._registeredTools[name];
14291
14457
  if (updates.name)
14292
14458
  this._registeredTools[updates.name] = registeredTool;
@@ -14437,6 +14603,15 @@ function isZodRawShape(obj) {
14437
14603
  function isZodTypeLike(value) {
14438
14604
  return value !== null && typeof value === "object" && "parse" in value && typeof value.parse === "function" && "safeParse" in value && typeof value.safeParse === "function";
14439
14605
  }
14606
+ function getZodSchemaObject(schema) {
14607
+ if (!schema) {
14608
+ return void 0;
14609
+ }
14610
+ if (isZodRawShape(schema)) {
14611
+ return external_exports.object(schema);
14612
+ }
14613
+ return schema;
14614
+ }
14440
14615
  function promptArgumentsFromSchema(schema) {
14441
14616
  return Object.entries(schema.shape).map(([name, field]) => ({
14442
14617
  name,