@workday/canvas-kit-mcp 14.1.18 → 15.0.0-alpha.0008-next.0

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.18",
6799
+ version: "14.1.19",
6800
6800
  description: "MCP package for Canvas Kit",
6801
6801
  author: "Workday, Inc. (https://www.workday.com)",
6802
6802
  license: "Apache-2.0",
@@ -10907,42 +10907,38 @@ 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"));
10911
10910
  var ProgressTokenSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
10912
10911
  var CursorSchema = external_exports.string();
10913
10912
  var RequestMetaSchema = external_exports.object({
10914
10913
  /**
10915
10914
  * 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.
10916
10915
  */
10917
- progressToken: ProgressTokenSchema.optional()
10916
+ progressToken: external_exports.optional(ProgressTokenSchema)
10918
10917
  }).passthrough();
10919
10918
  var BaseRequestParamsSchema = external_exports.object({
10920
- /**
10921
- * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
10922
- */
10923
- _meta: RequestMetaSchema.optional()
10924
- });
10919
+ _meta: external_exports.optional(RequestMetaSchema)
10920
+ }).passthrough();
10925
10921
  var RequestSchema = external_exports.object({
10926
10922
  method: external_exports.string(),
10927
- params: BaseRequestParamsSchema.passthrough().optional()
10923
+ params: external_exports.optional(BaseRequestParamsSchema)
10928
10924
  });
10929
- var NotificationsParamsSchema = external_exports.object({
10925
+ var BaseNotificationParamsSchema = external_exports.object({
10930
10926
  /**
10931
10927
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
10932
10928
  * for notes on _meta usage.
10933
10929
  */
10934
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10935
- });
10930
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
10931
+ }).passthrough();
10936
10932
  var NotificationSchema = external_exports.object({
10937
10933
  method: external_exports.string(),
10938
- params: NotificationsParamsSchema.passthrough().optional()
10934
+ params: external_exports.optional(BaseNotificationParamsSchema)
10939
10935
  });
10940
10936
  var ResultSchema = external_exports.object({
10941
10937
  /**
10942
10938
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
10943
10939
  * for notes on _meta usage.
10944
10940
  */
10945
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10941
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
10946
10942
  }).passthrough();
10947
10943
  var RequestIdSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
10948
10944
  var JSONRPCRequestSchema = external_exports.object({
@@ -10991,21 +10987,20 @@ var JSONRPCErrorSchema = external_exports.object({
10991
10987
  var isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
10992
10988
  var JSONRPCMessageSchema = external_exports.union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
10993
10989
  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
- });
11006
10990
  var CancelledNotificationSchema = NotificationSchema.extend({
11007
10991
  method: external_exports.literal("notifications/cancelled"),
11008
- params: CancelledNotificationParamsSchema
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
+ })
11009
11004
  });
11010
11005
  var IconSchema = external_exports.object({
11011
11006
  /**
@@ -11015,15 +11010,15 @@ var IconSchema = external_exports.object({
11015
11010
  /**
11016
11011
  * Optional MIME type for the icon.
11017
11012
  */
11018
- mimeType: external_exports.string().optional(),
11013
+ mimeType: external_exports.optional(external_exports.string()),
11019
11014
  /**
11020
11015
  * Optional array of strings that specify sizes at which the icon can be used.
11021
11016
  * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
11022
11017
  *
11023
11018
  * If not provided, the client should assume that the icon can be used at any size.
11024
11019
  */
11025
- sizes: external_exports.array(external_exports.string()).optional()
11026
- });
11020
+ sizes: external_exports.optional(external_exports.array(external_exports.string()))
11021
+ }).passthrough();
11027
11022
  var IconsSchema = external_exports.object({
11028
11023
  /**
11029
11024
  * Optional set of sized icons that the client can display in a user interface.
@@ -11037,7 +11032,7 @@ var IconsSchema = external_exports.object({
11037
11032
  * - `image/webp` - WebP images (modern, efficient format)
11038
11033
  */
11039
11034
  icons: external_exports.array(IconSchema).optional()
11040
- });
11035
+ }).passthrough();
11041
11036
  var BaseMetadataSchema = external_exports.object({
11042
11037
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
11043
11038
  name: external_exports.string(),
@@ -11049,68 +11044,62 @@ var BaseMetadataSchema = external_exports.object({
11049
11044
  * where `annotations.title` should be given precedence over using `name`,
11050
11045
  * if present).
11051
11046
  */
11052
- title: external_exports.string().optional()
11053
- });
11047
+ title: external_exports.optional(external_exports.string())
11048
+ }).passthrough();
11054
11049
  var ImplementationSchema = BaseMetadataSchema.extend({
11055
11050
  version: external_exports.string(),
11056
11051
  /**
11057
11052
  * An optional URL of the website for this implementation.
11058
11053
  */
11059
- websiteUrl: external_exports.string().optional()
11054
+ websiteUrl: external_exports.optional(external_exports.string())
11060
11055
  }).merge(IconsSchema);
11061
11056
  var ClientCapabilitiesSchema = external_exports.object({
11062
11057
  /**
11063
11058
  * Experimental, non-standard capabilities that the client supports.
11064
11059
  */
11065
- experimental: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
11060
+ experimental: external_exports.optional(external_exports.object({}).passthrough()),
11066
11061
  /**
11067
11062
  * Present if the client supports sampling from an LLM.
11068
11063
  */
11069
- sampling: AssertObjectSchema.optional(),
11064
+ sampling: external_exports.optional(external_exports.object({}).passthrough()),
11070
11065
  /**
11071
11066
  * Present if the client supports eliciting user input.
11072
11067
  */
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()),
11068
+ elicitation: external_exports.optional(external_exports.object({}).passthrough()),
11079
11069
  /**
11080
11070
  * Present if the client supports listing roots.
11081
11071
  */
11082
- roots: external_exports.object({
11072
+ roots: external_exports.optional(external_exports.object({
11083
11073
  /**
11084
11074
  * Whether the client supports issuing notifications for changes to the roots list.
11085
11075
  */
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
- });
11076
+ listChanged: external_exports.optional(external_exports.boolean())
11077
+ }).passthrough())
11078
+ }).passthrough();
11097
11079
  var InitializeRequestSchema = RequestSchema.extend({
11098
11080
  method: external_exports.literal("initialize"),
11099
- params: InitializeRequestParamsSchema
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
+ })
11100
11089
  });
11101
11090
  var ServerCapabilitiesSchema = external_exports.object({
11102
11091
  /**
11103
11092
  * Experimental, non-standard capabilities that the server supports.
11104
11093
  */
11105
- experimental: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
11094
+ experimental: external_exports.optional(external_exports.object({}).passthrough()),
11106
11095
  /**
11107
11096
  * Present if the server supports sending log messages to the client.
11108
11097
  */
11109
- logging: AssertObjectSchema.optional(),
11098
+ logging: external_exports.optional(external_exports.object({}).passthrough()),
11110
11099
  /**
11111
11100
  * Present if the server supports sending completions to the client.
11112
11101
  */
11113
- completions: AssertObjectSchema.optional(),
11102
+ completions: external_exports.optional(external_exports.object({}).passthrough()),
11114
11103
  /**
11115
11104
  * Present if the server offers any prompt templates.
11116
11105
  */
@@ -11119,30 +11108,30 @@ var ServerCapabilitiesSchema = external_exports.object({
11119
11108
  * Whether this server supports issuing notifications for changes to the prompt list.
11120
11109
  */
11121
11110
  listChanged: external_exports.optional(external_exports.boolean())
11122
- })),
11111
+ }).passthrough()),
11123
11112
  /**
11124
11113
  * Present if the server offers any resources to read.
11125
11114
  */
11126
- resources: external_exports.object({
11115
+ resources: external_exports.optional(external_exports.object({
11127
11116
  /**
11128
11117
  * Whether this server supports clients subscribing to resource updates.
11129
11118
  */
11130
- subscribe: external_exports.boolean().optional(),
11119
+ subscribe: external_exports.optional(external_exports.boolean()),
11131
11120
  /**
11132
11121
  * Whether this server supports issuing notifications for changes to the resource list.
11133
11122
  */
11134
- listChanged: external_exports.boolean().optional()
11135
- }).optional(),
11123
+ listChanged: external_exports.optional(external_exports.boolean())
11124
+ }).passthrough()),
11136
11125
  /**
11137
11126
  * Present if the server offers any tools to call.
11138
11127
  */
11139
- tools: external_exports.object({
11128
+ tools: external_exports.optional(external_exports.object({
11140
11129
  /**
11141
11130
  * Whether this server supports issuing notifications for changes to the tool list.
11142
11131
  */
11143
- listChanged: external_exports.boolean().optional()
11144
- }).optional()
11145
- });
11132
+ listChanged: external_exports.optional(external_exports.boolean())
11133
+ }).passthrough())
11134
+ }).passthrough();
11146
11135
  var InitializeResultSchema = ResultSchema.extend({
11147
11136
  /**
11148
11137
  * 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.
@@ -11155,7 +11144,7 @@ var InitializeResultSchema = ResultSchema.extend({
11155
11144
  *
11156
11145
  * 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.
11157
11146
  */
11158
- instructions: external_exports.string().optional()
11147
+ instructions: external_exports.optional(external_exports.string())
11159
11148
  });
11160
11149
  var InitializedNotificationSchema = NotificationSchema.extend({
11161
11150
  method: external_exports.literal("notifications/initialized")
@@ -11176,26 +11165,24 @@ var ProgressSchema = external_exports.object({
11176
11165
  * An optional message describing the current progress.
11177
11166
  */
11178
11167
  message: external_exports.optional(external_exports.string())
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
- });
11168
+ }).passthrough();
11186
11169
  var ProgressNotificationSchema = NotificationSchema.extend({
11187
11170
  method: external_exports.literal("notifications/progress"),
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()
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
+ })
11196
11177
  });
11197
11178
  var PaginatedRequestSchema = RequestSchema.extend({
11198
- params: PaginatedRequestParamsSchema.optional()
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()
11199
11186
  });
11200
11187
  var PaginatedResultSchema = ResultSchema.extend({
11201
11188
  /**
@@ -11217,8 +11204,8 @@ var ResourceContentsSchema = external_exports.object({
11217
11204
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11218
11205
  * for notes on _meta usage.
11219
11206
  */
11220
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11221
- });
11207
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
11208
+ }).passthrough();
11222
11209
  var TextResourceContentsSchema = ResourceContentsSchema.extend({
11223
11210
  /**
11224
11211
  * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
@@ -11293,18 +11280,14 @@ var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
11293
11280
  var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
11294
11281
  resourceTemplates: external_exports.array(ResourceTemplateSchema)
11295
11282
  });
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;
11305
11283
  var ReadResourceRequestSchema = RequestSchema.extend({
11306
11284
  method: external_exports.literal("resources/read"),
11307
- params: ReadResourceRequestParamsSchema
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
+ })
11308
11291
  });
11309
11292
  var ReadResourceResultSchema = ResultSchema.extend({
11310
11293
  contents: external_exports.array(external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
@@ -11312,25 +11295,32 @@ var ReadResourceResultSchema = ResultSchema.extend({
11312
11295
  var ResourceListChangedNotificationSchema = NotificationSchema.extend({
11313
11296
  method: external_exports.literal("notifications/resources/list_changed")
11314
11297
  });
11315
- var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
11316
11298
  var SubscribeRequestSchema = RequestSchema.extend({
11317
11299
  method: external_exports.literal("resources/subscribe"),
11318
- params: SubscribeRequestParamsSchema
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
+ })
11319
11306
  });
11320
- var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
11321
11307
  var UnsubscribeRequestSchema = RequestSchema.extend({
11322
11308
  method: external_exports.literal("resources/unsubscribe"),
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()
11309
+ params: BaseRequestParamsSchema.extend({
11310
+ /**
11311
+ * The URI of the resource to unsubscribe from.
11312
+ */
11313
+ uri: external_exports.string()
11314
+ })
11330
11315
  });
11331
11316
  var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
11332
11317
  method: external_exports.literal("notifications/resources/updated"),
11333
- params: ResourceUpdatedNotificationParamsSchema
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
+ })
11334
11324
  });
11335
11325
  var PromptArgumentSchema = external_exports.object({
11336
11326
  /**
@@ -11345,7 +11335,7 @@ var PromptArgumentSchema = external_exports.object({
11345
11335
  * Whether this argument must be provided.
11346
11336
  */
11347
11337
  required: external_exports.optional(external_exports.boolean())
11348
- });
11338
+ }).passthrough();
11349
11339
  var PromptSchema = BaseMetadataSchema.extend({
11350
11340
  /**
11351
11341
  * An optional description of what this prompt provides
@@ -11367,19 +11357,18 @@ var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
11367
11357
  var ListPromptsResultSchema = PaginatedResultSchema.extend({
11368
11358
  prompts: external_exports.array(PromptSchema)
11369
11359
  });
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
- });
11380
11360
  var GetPromptRequestSchema = RequestSchema.extend({
11381
11361
  method: external_exports.literal("prompts/get"),
11382
- params: GetPromptRequestParamsSchema
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
+ })
11383
11372
  });
11384
11373
  var TextContentSchema = external_exports.object({
11385
11374
  type: external_exports.literal("text"),
@@ -11391,8 +11380,8 @@ var TextContentSchema = external_exports.object({
11391
11380
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11392
11381
  * for notes on _meta usage.
11393
11382
  */
11394
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11395
- });
11383
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
11384
+ }).passthrough();
11396
11385
  var ImageContentSchema = external_exports.object({
11397
11386
  type: external_exports.literal("image"),
11398
11387
  /**
@@ -11407,8 +11396,8 @@ var ImageContentSchema = external_exports.object({
11407
11396
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11408
11397
  * for notes on _meta usage.
11409
11398
  */
11410
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11411
- });
11399
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
11400
+ }).passthrough();
11412
11401
  var AudioContentSchema = external_exports.object({
11413
11402
  type: external_exports.literal("audio"),
11414
11403
  /**
@@ -11423,8 +11412,8 @@ var AudioContentSchema = external_exports.object({
11423
11412
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11424
11413
  * for notes on _meta usage.
11425
11414
  */
11426
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11427
- });
11415
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
11416
+ }).passthrough();
11428
11417
  var EmbeddedResourceSchema = external_exports.object({
11429
11418
  type: external_exports.literal("resource"),
11430
11419
  resource: external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
@@ -11432,8 +11421,8 @@ var EmbeddedResourceSchema = external_exports.object({
11432
11421
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11433
11422
  * for notes on _meta usage.
11434
11423
  */
11435
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11436
- });
11424
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
11425
+ }).passthrough();
11437
11426
  var ResourceLinkSchema = ResourceSchema.extend({
11438
11427
  type: external_exports.literal("resource_link")
11439
11428
  });
@@ -11447,7 +11436,7 @@ var ContentBlockSchema = external_exports.union([
11447
11436
  var PromptMessageSchema = external_exports.object({
11448
11437
  role: external_exports.enum(["user", "assistant"]),
11449
11438
  content: ContentBlockSchema
11450
- });
11439
+ }).passthrough();
11451
11440
  var GetPromptResultSchema = ResultSchema.extend({
11452
11441
  /**
11453
11442
  * An optional description for the prompt.
@@ -11462,13 +11451,13 @@ var ToolAnnotationsSchema = external_exports.object({
11462
11451
  /**
11463
11452
  * A human-readable title for the tool.
11464
11453
  */
11465
- title: external_exports.string().optional(),
11454
+ title: external_exports.optional(external_exports.string()),
11466
11455
  /**
11467
11456
  * If true, the tool does not modify its environment.
11468
11457
  *
11469
11458
  * Default: false
11470
11459
  */
11471
- readOnlyHint: external_exports.boolean().optional(),
11460
+ readOnlyHint: external_exports.optional(external_exports.boolean()),
11472
11461
  /**
11473
11462
  * If true, the tool may perform destructive updates to its environment.
11474
11463
  * If false, the tool performs only additive updates.
@@ -11477,7 +11466,7 @@ var ToolAnnotationsSchema = external_exports.object({
11477
11466
  *
11478
11467
  * Default: true
11479
11468
  */
11480
- destructiveHint: external_exports.boolean().optional(),
11469
+ destructiveHint: external_exports.optional(external_exports.boolean()),
11481
11470
  /**
11482
11471
  * If true, calling the tool repeatedly with the same arguments
11483
11472
  * will have no additional effect on the its environment.
@@ -11486,7 +11475,7 @@ var ToolAnnotationsSchema = external_exports.object({
11486
11475
  *
11487
11476
  * Default: false
11488
11477
  */
11489
- idempotentHint: external_exports.boolean().optional(),
11478
+ idempotentHint: external_exports.optional(external_exports.boolean()),
11490
11479
  /**
11491
11480
  * If true, this tool may interact with an "open world" of external
11492
11481
  * entities. If false, the tool's domain of interaction is closed.
@@ -11495,34 +11484,30 @@ var ToolAnnotationsSchema = external_exports.object({
11495
11484
  *
11496
11485
  * Default: true
11497
11486
  */
11498
- openWorldHint: external_exports.boolean().optional()
11499
- });
11487
+ openWorldHint: external_exports.optional(external_exports.boolean())
11488
+ }).passthrough();
11500
11489
  var ToolSchema = BaseMetadataSchema.extend({
11501
11490
  /**
11502
11491
  * A human-readable description of the tool.
11503
11492
  */
11504
- description: external_exports.string().optional(),
11493
+ description: external_exports.optional(external_exports.string()),
11505
11494
  /**
11506
11495
  * A JSON Schema object defining the expected parameters for the tool.
11507
11496
  */
11508
11497
  inputSchema: external_exports.object({
11509
11498
  type: external_exports.literal("object"),
11510
- properties: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
11499
+ properties: external_exports.optional(external_exports.object({}).passthrough()),
11511
11500
  required: external_exports.optional(external_exports.array(external_exports.string()))
11512
- }),
11501
+ }).passthrough(),
11513
11502
  /**
11514
11503
  * An optional JSON Schema object defining the structure of the tool's output returned in
11515
11504
  * the structuredContent field of a CallToolResult.
11516
11505
  */
11517
- outputSchema: external_exports.object({
11506
+ outputSchema: external_exports.optional(external_exports.object({
11518
11507
  type: external_exports.literal("object"),
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(),
11508
+ properties: external_exports.optional(external_exports.object({}).passthrough()),
11509
+ required: external_exports.optional(external_exports.array(external_exports.string()))
11510
+ }).passthrough()),
11526
11511
  /**
11527
11512
  * Optional additional tool information.
11528
11513
  */
@@ -11531,7 +11516,7 @@ var ToolSchema = BaseMetadataSchema.extend({
11531
11516
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11532
11517
  * for notes on _meta usage.
11533
11518
  */
11534
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11519
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
11535
11520
  }).merge(IconsSchema);
11536
11521
  var ListToolsRequestSchema = PaginatedRequestSchema.extend({
11537
11522
  method: external_exports.literal("tools/list")
@@ -11552,7 +11537,7 @@ var CallToolResultSchema = ResultSchema.extend({
11552
11537
  *
11553
11538
  * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
11554
11539
  */
11555
- structuredContent: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
11540
+ structuredContent: external_exports.object({}).passthrough().optional(),
11556
11541
  /**
11557
11542
  * Whether the tool call ended in an error.
11558
11543
  *
@@ -11572,58 +11557,49 @@ var CallToolResultSchema = ResultSchema.extend({
11572
11557
  var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
11573
11558
  toolResult: external_exports.unknown()
11574
11559
  }));
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
- });
11585
11560
  var CallToolRequestSchema = RequestSchema.extend({
11586
11561
  method: external_exports.literal("tools/call"),
11587
- params: CallToolRequestParamsSchema
11562
+ params: BaseRequestParamsSchema.extend({
11563
+ name: external_exports.string(),
11564
+ arguments: external_exports.optional(external_exports.record(external_exports.unknown()))
11565
+ })
11588
11566
  });
11589
11567
  var ToolListChangedNotificationSchema = NotificationSchema.extend({
11590
11568
  method: external_exports.literal("notifications/tools/list_changed")
11591
11569
  });
11592
11570
  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
- });
11599
11571
  var SetLevelRequestSchema = RequestSchema.extend({
11600
11572
  method: external_exports.literal("logging/setLevel"),
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()
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
+ })
11616
11579
  });
11617
11580
  var LoggingMessageNotificationSchema = NotificationSchema.extend({
11618
11581
  method: external_exports.literal("notifications/message"),
11619
- params: LoggingMessageNotificationParamsSchema
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
+ })
11620
11596
  });
11621
11597
  var ModelHintSchema = external_exports.object({
11622
11598
  /**
11623
11599
  * A hint for a model name.
11624
11600
  */
11625
11601
  name: external_exports.string().optional()
11626
- });
11602
+ }).passthrough();
11627
11603
  var ModelPreferencesSchema = external_exports.object({
11628
11604
  /**
11629
11605
  * Optional hints to use for model selection.
@@ -11641,41 +11617,38 @@ var ModelPreferencesSchema = external_exports.object({
11641
11617
  * How much to prioritize intelligence and capabilities when selecting a model.
11642
11618
  */
11643
11619
  intelligencePriority: external_exports.optional(external_exports.number().min(0).max(1))
11644
- });
11620
+ }).passthrough();
11645
11621
  var SamplingMessageSchema = external_exports.object({
11646
11622
  role: external_exports.enum(["user", "assistant"]),
11647
11623
  content: external_exports.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
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
- });
11624
+ }).passthrough();
11676
11625
  var CreateMessageRequestSchema = RequestSchema.extend({
11677
11626
  method: external_exports.literal("sampling/createMessage"),
11678
- params: CreateMessageRequestParamsSchema
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
+ })
11679
11652
  });
11680
11653
  var CreateMessageResultSchema = ResultSchema.extend({
11681
11654
  /**
@@ -11691,114 +11664,59 @@ var CreateMessageResultSchema = ResultSchema.extend({
11691
11664
  });
11692
11665
  var BooleanSchemaSchema = external_exports.object({
11693
11666
  type: external_exports.literal("boolean"),
11694
- title: external_exports.string().optional(),
11695
- description: external_exports.string().optional(),
11696
- default: external_exports.boolean().optional()
11697
- });
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();
11698
11671
  var StringSchemaSchema = external_exports.object({
11699
11672
  type: external_exports.literal("string"),
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
- });
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();
11707
11679
  var NumberSchemaSchema = external_exports.object({
11708
11680
  type: external_exports.enum(["number", "integer"]),
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({
11716
- type: external_exports.literal("string"),
11717
- title: external_exports.string().optional(),
11718
- description: external_exports.string().optional(),
11719
- enum: external_exports.array(external_exports.string()),
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({
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({
11733
11687
  type: external_exports.literal("string"),
11734
- title: external_exports.string().optional(),
11735
- description: external_exports.string().optional(),
11688
+ title: external_exports.optional(external_exports.string()),
11689
+ description: external_exports.optional(external_exports.string()),
11736
11690
  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
- });
11691
+ enumNames: external_exports.optional(external_exports.array(external_exports.string()))
11692
+ }).passthrough();
11693
+ var PrimitiveSchemaDefinitionSchema = external_exports.union([BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema]);
11785
11694
  var ElicitRequestSchema = RequestSchema.extend({
11786
11695
  method: external_exports.literal("elicitation/create"),
11787
- params: ElicitRequestParamsSchema
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
+ })
11788
11710
  });
11789
11711
  var ElicitResultSchema = ResultSchema.extend({
11790
11712
  /**
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
11713
+ * The user's response action.
11795
11714
  */
11796
11715
  action: external_exports.enum(["accept", "decline", "cancel"]),
11797
11716
  /**
11798
- * The submitted form data, only present when action is "accept".
11799
- * Contains values matching the requested schema.
11717
+ * The collected user input content (only present if action is "accept").
11800
11718
  */
11801
- content: external_exports.record(external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), external_exports.array(external_exports.string())])).optional()
11719
+ content: external_exports.optional(external_exports.record(external_exports.string(), external_exports.unknown()))
11802
11720
  });
11803
11721
  var ResourceTemplateReferenceSchema = external_exports.object({
11804
11722
  type: external_exports.literal("ref/resource"),
@@ -11806,50 +11724,39 @@ var ResourceTemplateReferenceSchema = external_exports.object({
11806
11724
  * The URI or URI template of the resource.
11807
11725
  */
11808
11726
  uri: external_exports.string()
11809
- });
11727
+ }).passthrough();
11810
11728
  var PromptReferenceSchema = external_exports.object({
11811
11729
  type: external_exports.literal("ref/prompt"),
11812
11730
  /**
11813
11731
  * The name of the prompt or prompt template
11814
11732
  */
11815
11733
  name: external_exports.string()
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({
11823
- /**
11824
- * The name of the argument
11825
- */
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
- });
11734
+ }).passthrough();
11839
11735
  var CompleteRequestSchema = RequestSchema.extend({
11840
11736
  method: external_exports.literal("completion/complete"),
11841
- params: CompleteRequestParamsSchema
11737
+ params: BaseRequestParamsSchema.extend({
11738
+ ref: external_exports.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
11739
+ /**
11740
+ * The argument's information
11741
+ */
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
+ })
11842
11759
  });
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
- }
11853
11760
  var CompleteResultSchema = ResultSchema.extend({
11854
11761
  completion: external_exports.object({
11855
11762
  /**
@@ -11874,13 +11781,13 @@ var RootSchema = external_exports.object({
11874
11781
  /**
11875
11782
  * An optional name for the root.
11876
11783
  */
11877
- name: external_exports.string().optional(),
11784
+ name: external_exports.optional(external_exports.string()),
11878
11785
  /**
11879
11786
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
11880
11787
  * for notes on _meta usage.
11881
11788
  */
11882
- _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11883
- });
11789
+ _meta: external_exports.optional(external_exports.object({}).passthrough())
11790
+ }).passthrough();
11884
11791
  var ListRootsRequestSchema = RequestSchema.extend({
11885
11792
  method: external_exports.literal("roots/list")
11886
11793
  });
@@ -12313,24 +12220,15 @@ var Protocol = class {
12313
12220
  this._notificationHandlers.delete(method);
12314
12221
  }
12315
12222
  };
12316
- function isPlainObject(value) {
12317
- return value !== null && typeof value === "object" && !Array.isArray(value);
12318
- }
12319
12223
  function mergeCapabilities(base, additional) {
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 };
12224
+ return Object.entries(additional).reduce((acc, [key, value]) => {
12225
+ if (value && typeof value === "object") {
12226
+ acc[key] = acc[key] ? { ...acc[key], ...value } : value;
12329
12227
  } else {
12330
- result[k] = addValue;
12228
+ acc[key] = value;
12331
12229
  }
12332
- }
12333
- return result;
12230
+ return acc;
12231
+ }, { ...base });
12334
12232
  }
12335
12233
 
12336
12234
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
@@ -12502,9 +12400,9 @@ var Server = class extends Protocol {
12502
12400
  }
12503
12401
  assertRequestHandlerCapability(method) {
12504
12402
  switch (method) {
12505
- case "completion/complete":
12506
- if (!this._capabilities.completions) {
12507
- throw new Error(`Server does not support completions (required for ${method})`);
12403
+ case "sampling/createMessage":
12404
+ if (!this._capabilities.sampling) {
12405
+ throw new Error(`Server does not support sampling (required for ${method})`);
12508
12406
  }
12509
12407
  break;
12510
12408
  case "logging/setLevel":
@@ -13959,64 +13857,6 @@ function processCreateParams2(params) {
13959
13857
  return { errorMap: customMap, description };
13960
13858
  }
13961
13859
 
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
-
14020
13860
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
14021
13861
  var McpServer = class {
14022
13862
  constructor(serverInfo, options) {
@@ -14143,10 +13983,8 @@ var McpServer = class {
14143
13983
  this.server.setRequestHandler(CompleteRequestSchema, async (request) => {
14144
13984
  switch (request.params.ref.type) {
14145
13985
  case "ref/prompt":
14146
- assertCompleteRequestPrompt(request);
14147
13986
  return this.handlePromptCompletion(request, request.params.ref);
14148
13987
  case "ref/resource":
14149
- assertCompleteRequestResourceTemplate(request);
14150
13988
  return this.handleResourceCompletion(request, request.params.ref);
14151
13989
  default:
14152
13990
  throw new McpError(ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`);
@@ -14435,12 +14273,11 @@ var McpServer = class {
14435
14273
  return registeredPrompt;
14436
14274
  }
14437
14275
  _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, _meta, callback) {
14438
- validateAndWarnToolName(name);
14439
14276
  const registeredTool = {
14440
14277
  title,
14441
14278
  description,
14442
- inputSchema: getZodSchemaObject(inputSchema),
14443
- outputSchema: getZodSchemaObject(outputSchema),
14279
+ inputSchema: inputSchema === void 0 ? void 0 : external_exports.object(inputSchema),
14280
+ outputSchema: outputSchema === void 0 ? void 0 : external_exports.object(outputSchema),
14444
14281
  annotations,
14445
14282
  _meta,
14446
14283
  callback,
@@ -14450,9 +14287,6 @@ var McpServer = class {
14450
14287
  remove: () => registeredTool.update({ name: null }),
14451
14288
  update: (updates) => {
14452
14289
  if (typeof updates.name !== "undefined" && updates.name !== name) {
14453
- if (typeof updates.name === "string") {
14454
- validateAndWarnToolName(updates.name);
14455
- }
14456
14290
  delete this._registeredTools[name];
14457
14291
  if (updates.name)
14458
14292
  this._registeredTools[updates.name] = registeredTool;
@@ -14603,15 +14437,6 @@ function isZodRawShape(obj) {
14603
14437
  function isZodTypeLike(value) {
14604
14438
  return value !== null && typeof value === "object" && "parse" in value && typeof value.parse === "function" && "safeParse" in value && typeof value.safeParse === "function";
14605
14439
  }
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
- }
14615
14440
  function promptArgumentsFromSchema(schema) {
14616
14441
  return Object.entries(schema.shape).map(([name, field]) => ({
14617
14442
  name,