@kentico/management-api-mcp 30.12.0-preview → 30.12.1-preview

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.
Files changed (2) hide show
  1. package/dist/index.js +434 -259
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -16523,38 +16523,42 @@ var NEVER = INVALID;
16523
16523
  var LATEST_PROTOCOL_VERSION = "2025-06-18";
16524
16524
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-03-26", "2024-11-05", "2024-10-07"];
16525
16525
  var JSONRPC_VERSION = "2.0";
16526
+ var AssertObjectSchema = external_exports.custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
16526
16527
  var ProgressTokenSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
16527
16528
  var CursorSchema = external_exports.string();
16528
16529
  var RequestMetaSchema = external_exports.object({
16529
16530
  /**
16530
16531
  * 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.
16531
16532
  */
16532
- progressToken: external_exports.optional(ProgressTokenSchema)
16533
+ progressToken: ProgressTokenSchema.optional()
16533
16534
  }).passthrough();
16534
16535
  var BaseRequestParamsSchema = external_exports.object({
16535
- _meta: external_exports.optional(RequestMetaSchema)
16536
- }).passthrough();
16536
+ /**
16537
+ * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
16538
+ */
16539
+ _meta: RequestMetaSchema.optional()
16540
+ });
16537
16541
  var RequestSchema = external_exports.object({
16538
16542
  method: external_exports.string(),
16539
- params: external_exports.optional(BaseRequestParamsSchema)
16543
+ params: BaseRequestParamsSchema.passthrough().optional()
16540
16544
  });
16541
- var BaseNotificationParamsSchema = external_exports.object({
16545
+ var NotificationsParamsSchema = external_exports.object({
16542
16546
  /**
16543
16547
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
16544
16548
  * for notes on _meta usage.
16545
16549
  */
16546
- _meta: external_exports.optional(external_exports.object({}).passthrough())
16547
- }).passthrough();
16550
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
16551
+ });
16548
16552
  var NotificationSchema = external_exports.object({
16549
16553
  method: external_exports.string(),
16550
- params: external_exports.optional(BaseNotificationParamsSchema)
16554
+ params: NotificationsParamsSchema.passthrough().optional()
16551
16555
  });
16552
16556
  var ResultSchema = external_exports.object({
16553
16557
  /**
16554
16558
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
16555
16559
  * for notes on _meta usage.
16556
16560
  */
16557
- _meta: external_exports.optional(external_exports.object({}).passthrough())
16561
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
16558
16562
  }).passthrough();
16559
16563
  var RequestIdSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
16560
16564
  var JSONRPCRequestSchema = external_exports.object({
@@ -16603,20 +16607,21 @@ var JSONRPCErrorSchema = external_exports.object({
16603
16607
  var isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
16604
16608
  var JSONRPCMessageSchema = external_exports.union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
16605
16609
  var EmptyResultSchema = ResultSchema.strict();
16610
+ var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
16611
+ /**
16612
+ * The ID of the request to cancel.
16613
+ *
16614
+ * This MUST correspond to the ID of a request previously issued in the same direction.
16615
+ */
16616
+ requestId: RequestIdSchema,
16617
+ /**
16618
+ * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
16619
+ */
16620
+ reason: external_exports.string().optional()
16621
+ });
16606
16622
  var CancelledNotificationSchema = NotificationSchema.extend({
16607
16623
  method: external_exports.literal("notifications/cancelled"),
16608
- params: BaseNotificationParamsSchema.extend({
16609
- /**
16610
- * The ID of the request to cancel.
16611
- *
16612
- * This MUST correspond to the ID of a request previously issued in the same direction.
16613
- */
16614
- requestId: RequestIdSchema,
16615
- /**
16616
- * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
16617
- */
16618
- reason: external_exports.string().optional()
16619
- })
16624
+ params: CancelledNotificationParamsSchema
16620
16625
  });
16621
16626
  var IconSchema = external_exports.object({
16622
16627
  /**
@@ -16626,15 +16631,15 @@ var IconSchema = external_exports.object({
16626
16631
  /**
16627
16632
  * Optional MIME type for the icon.
16628
16633
  */
16629
- mimeType: external_exports.optional(external_exports.string()),
16634
+ mimeType: external_exports.string().optional(),
16630
16635
  /**
16631
16636
  * Optional array of strings that specify sizes at which the icon can be used.
16632
16637
  * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
16633
16638
  *
16634
16639
  * If not provided, the client should assume that the icon can be used at any size.
16635
16640
  */
16636
- sizes: external_exports.optional(external_exports.array(external_exports.string()))
16637
- }).passthrough();
16641
+ sizes: external_exports.array(external_exports.string()).optional()
16642
+ });
16638
16643
  var IconsSchema = external_exports.object({
16639
16644
  /**
16640
16645
  * Optional set of sized icons that the client can display in a user interface.
@@ -16648,7 +16653,7 @@ var IconsSchema = external_exports.object({
16648
16653
  * - `image/webp` - WebP images (modern, efficient format)
16649
16654
  */
16650
16655
  icons: external_exports.array(IconSchema).optional()
16651
- }).passthrough();
16656
+ });
16652
16657
  var BaseMetadataSchema = external_exports.object({
16653
16658
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
16654
16659
  name: external_exports.string(),
@@ -16660,62 +16665,68 @@ var BaseMetadataSchema = external_exports.object({
16660
16665
  * where `annotations.title` should be given precedence over using `name`,
16661
16666
  * if present).
16662
16667
  */
16663
- title: external_exports.optional(external_exports.string())
16664
- }).passthrough();
16668
+ title: external_exports.string().optional()
16669
+ });
16665
16670
  var ImplementationSchema = BaseMetadataSchema.extend({
16666
16671
  version: external_exports.string(),
16667
16672
  /**
16668
16673
  * An optional URL of the website for this implementation.
16669
16674
  */
16670
- websiteUrl: external_exports.optional(external_exports.string())
16675
+ websiteUrl: external_exports.string().optional()
16671
16676
  }).merge(IconsSchema);
16672
16677
  var ClientCapabilitiesSchema = external_exports.object({
16673
16678
  /**
16674
16679
  * Experimental, non-standard capabilities that the client supports.
16675
16680
  */
16676
- experimental: external_exports.optional(external_exports.object({}).passthrough()),
16681
+ experimental: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
16677
16682
  /**
16678
16683
  * Present if the client supports sampling from an LLM.
16679
16684
  */
16680
- sampling: external_exports.optional(external_exports.object({}).passthrough()),
16685
+ sampling: AssertObjectSchema.optional(),
16681
16686
  /**
16682
16687
  * Present if the client supports eliciting user input.
16683
16688
  */
16684
- elicitation: external_exports.optional(external_exports.object({}).passthrough()),
16689
+ elicitation: external_exports.intersection(external_exports.object({
16690
+ /**
16691
+ * Whether the client should apply defaults to the user input.
16692
+ */
16693
+ applyDefaults: external_exports.boolean().optional()
16694
+ }).optional(), external_exports.record(external_exports.string(), external_exports.unknown()).optional()),
16685
16695
  /**
16686
16696
  * Present if the client supports listing roots.
16687
16697
  */
16688
- roots: external_exports.optional(external_exports.object({
16698
+ roots: external_exports.object({
16689
16699
  /**
16690
16700
  * Whether the client supports issuing notifications for changes to the roots list.
16691
16701
  */
16692
- listChanged: external_exports.optional(external_exports.boolean())
16693
- }).passthrough())
16694
- }).passthrough();
16702
+ listChanged: external_exports.boolean().optional()
16703
+ }).optional()
16704
+ });
16705
+ var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
16706
+ /**
16707
+ * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
16708
+ */
16709
+ protocolVersion: external_exports.string(),
16710
+ capabilities: ClientCapabilitiesSchema,
16711
+ clientInfo: ImplementationSchema
16712
+ });
16695
16713
  var InitializeRequestSchema = RequestSchema.extend({
16696
16714
  method: external_exports.literal("initialize"),
16697
- params: BaseRequestParamsSchema.extend({
16698
- /**
16699
- * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
16700
- */
16701
- protocolVersion: external_exports.string(),
16702
- capabilities: ClientCapabilitiesSchema,
16703
- clientInfo: ImplementationSchema
16704
- })
16715
+ params: InitializeRequestParamsSchema
16705
16716
  });
16706
16717
  var ServerCapabilitiesSchema = external_exports.object({
16707
16718
  /**
16708
16719
  * Experimental, non-standard capabilities that the server supports.
16709
16720
  */
16710
- experimental: external_exports.optional(external_exports.object({}).passthrough()),
16721
+ experimental: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
16711
16722
  /**
16712
16723
  * Present if the server supports sending log messages to the client.
16713
16724
  */
16714
- logging: external_exports.optional(external_exports.object({}).passthrough()),
16725
+ logging: AssertObjectSchema.optional(),
16715
16726
  /**
16716
16727
  * Present if the server supports sending completions to the client.
16717
16728
  */
16718
- completions: external_exports.optional(external_exports.object({}).passthrough()),
16729
+ completions: AssertObjectSchema.optional(),
16719
16730
  /**
16720
16731
  * Present if the server offers any prompt templates.
16721
16732
  */
@@ -16724,30 +16735,30 @@ var ServerCapabilitiesSchema = external_exports.object({
16724
16735
  * Whether this server supports issuing notifications for changes to the prompt list.
16725
16736
  */
16726
16737
  listChanged: external_exports.optional(external_exports.boolean())
16727
- }).passthrough()),
16738
+ })),
16728
16739
  /**
16729
16740
  * Present if the server offers any resources to read.
16730
16741
  */
16731
- resources: external_exports.optional(external_exports.object({
16742
+ resources: external_exports.object({
16732
16743
  /**
16733
16744
  * Whether this server supports clients subscribing to resource updates.
16734
16745
  */
16735
- subscribe: external_exports.optional(external_exports.boolean()),
16746
+ subscribe: external_exports.boolean().optional(),
16736
16747
  /**
16737
16748
  * Whether this server supports issuing notifications for changes to the resource list.
16738
16749
  */
16739
- listChanged: external_exports.optional(external_exports.boolean())
16740
- }).passthrough()),
16750
+ listChanged: external_exports.boolean().optional()
16751
+ }).optional(),
16741
16752
  /**
16742
16753
  * Present if the server offers any tools to call.
16743
16754
  */
16744
- tools: external_exports.optional(external_exports.object({
16755
+ tools: external_exports.object({
16745
16756
  /**
16746
16757
  * Whether this server supports issuing notifications for changes to the tool list.
16747
16758
  */
16748
- listChanged: external_exports.optional(external_exports.boolean())
16749
- }).passthrough())
16750
- }).passthrough();
16759
+ listChanged: external_exports.boolean().optional()
16760
+ }).optional()
16761
+ });
16751
16762
  var InitializeResultSchema = ResultSchema.extend({
16752
16763
  /**
16753
16764
  * 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.
@@ -16760,7 +16771,7 @@ var InitializeResultSchema = ResultSchema.extend({
16760
16771
  *
16761
16772
  * 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.
16762
16773
  */
16763
- instructions: external_exports.optional(external_exports.string())
16774
+ instructions: external_exports.string().optional()
16764
16775
  });
16765
16776
  var InitializedNotificationSchema = NotificationSchema.extend({
16766
16777
  method: external_exports.literal("notifications/initialized")
@@ -16781,24 +16792,26 @@ var ProgressSchema = external_exports.object({
16781
16792
  * An optional message describing the current progress.
16782
16793
  */
16783
16794
  message: external_exports.optional(external_exports.string())
16784
- }).passthrough();
16795
+ });
16796
+ var ProgressNotificationParamsSchema = NotificationsParamsSchema.merge(ProgressSchema).extend({
16797
+ /**
16798
+ * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
16799
+ */
16800
+ progressToken: ProgressTokenSchema
16801
+ });
16785
16802
  var ProgressNotificationSchema = NotificationSchema.extend({
16786
16803
  method: external_exports.literal("notifications/progress"),
16787
- params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
16788
- /**
16789
- * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
16790
- */
16791
- progressToken: ProgressTokenSchema
16792
- })
16804
+ params: ProgressNotificationParamsSchema
16805
+ });
16806
+ var PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
16807
+ /**
16808
+ * An opaque token representing the current pagination position.
16809
+ * If provided, the server should return results starting after this cursor.
16810
+ */
16811
+ cursor: CursorSchema.optional()
16793
16812
  });
16794
16813
  var PaginatedRequestSchema = RequestSchema.extend({
16795
- params: BaseRequestParamsSchema.extend({
16796
- /**
16797
- * An opaque token representing the current pagination position.
16798
- * If provided, the server should return results starting after this cursor.
16799
- */
16800
- cursor: external_exports.optional(CursorSchema)
16801
- }).optional()
16814
+ params: PaginatedRequestParamsSchema.optional()
16802
16815
  });
16803
16816
  var PaginatedResultSchema = ResultSchema.extend({
16804
16817
  /**
@@ -16820,8 +16833,8 @@ var ResourceContentsSchema = external_exports.object({
16820
16833
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
16821
16834
  * for notes on _meta usage.
16822
16835
  */
16823
- _meta: external_exports.optional(external_exports.object({}).passthrough())
16824
- }).passthrough();
16836
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
16837
+ });
16825
16838
  var TextResourceContentsSchema = ResourceContentsSchema.extend({
16826
16839
  /**
16827
16840
  * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
@@ -16896,14 +16909,18 @@ var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
16896
16909
  var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
16897
16910
  resourceTemplates: external_exports.array(ResourceTemplateSchema)
16898
16911
  });
16912
+ var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
16913
+ /**
16914
+ * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
16915
+ *
16916
+ * @format uri
16917
+ */
16918
+ uri: external_exports.string()
16919
+ });
16920
+ var ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
16899
16921
  var ReadResourceRequestSchema = RequestSchema.extend({
16900
16922
  method: external_exports.literal("resources/read"),
16901
- params: BaseRequestParamsSchema.extend({
16902
- /**
16903
- * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
16904
- */
16905
- uri: external_exports.string()
16906
- })
16923
+ params: ReadResourceRequestParamsSchema
16907
16924
  });
16908
16925
  var ReadResourceResultSchema = ResultSchema.extend({
16909
16926
  contents: external_exports.array(external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
@@ -16911,32 +16928,25 @@ var ReadResourceResultSchema = ResultSchema.extend({
16911
16928
  var ResourceListChangedNotificationSchema = NotificationSchema.extend({
16912
16929
  method: external_exports.literal("notifications/resources/list_changed")
16913
16930
  });
16931
+ var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
16914
16932
  var SubscribeRequestSchema = RequestSchema.extend({
16915
16933
  method: external_exports.literal("resources/subscribe"),
16916
- params: BaseRequestParamsSchema.extend({
16917
- /**
16918
- * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
16919
- */
16920
- uri: external_exports.string()
16921
- })
16934
+ params: SubscribeRequestParamsSchema
16922
16935
  });
16936
+ var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
16923
16937
  var UnsubscribeRequestSchema = RequestSchema.extend({
16924
16938
  method: external_exports.literal("resources/unsubscribe"),
16925
- params: BaseRequestParamsSchema.extend({
16926
- /**
16927
- * The URI of the resource to unsubscribe from.
16928
- */
16929
- uri: external_exports.string()
16930
- })
16939
+ params: UnsubscribeRequestParamsSchema
16940
+ });
16941
+ var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
16942
+ /**
16943
+ * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
16944
+ */
16945
+ uri: external_exports.string()
16931
16946
  });
16932
16947
  var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
16933
16948
  method: external_exports.literal("notifications/resources/updated"),
16934
- params: BaseNotificationParamsSchema.extend({
16935
- /**
16936
- * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
16937
- */
16938
- uri: external_exports.string()
16939
- })
16949
+ params: ResourceUpdatedNotificationParamsSchema
16940
16950
  });
16941
16951
  var PromptArgumentSchema = external_exports.object({
16942
16952
  /**
@@ -16951,7 +16961,7 @@ var PromptArgumentSchema = external_exports.object({
16951
16961
  * Whether this argument must be provided.
16952
16962
  */
16953
16963
  required: external_exports.optional(external_exports.boolean())
16954
- }).passthrough();
16964
+ });
16955
16965
  var PromptSchema = BaseMetadataSchema.extend({
16956
16966
  /**
16957
16967
  * An optional description of what this prompt provides
@@ -16973,18 +16983,19 @@ var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
16973
16983
  var ListPromptsResultSchema = PaginatedResultSchema.extend({
16974
16984
  prompts: external_exports.array(PromptSchema)
16975
16985
  });
16986
+ var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
16987
+ /**
16988
+ * The name of the prompt or prompt template.
16989
+ */
16990
+ name: external_exports.string(),
16991
+ /**
16992
+ * Arguments to use for templating the prompt.
16993
+ */
16994
+ arguments: external_exports.record(external_exports.string(), external_exports.string()).optional()
16995
+ });
16976
16996
  var GetPromptRequestSchema = RequestSchema.extend({
16977
16997
  method: external_exports.literal("prompts/get"),
16978
- params: BaseRequestParamsSchema.extend({
16979
- /**
16980
- * The name of the prompt or prompt template.
16981
- */
16982
- name: external_exports.string(),
16983
- /**
16984
- * Arguments to use for templating the prompt.
16985
- */
16986
- arguments: external_exports.optional(external_exports.record(external_exports.string()))
16987
- })
16998
+ params: GetPromptRequestParamsSchema
16988
16999
  });
16989
17000
  var TextContentSchema = external_exports.object({
16990
17001
  type: external_exports.literal("text"),
@@ -16996,8 +17007,8 @@ var TextContentSchema = external_exports.object({
16996
17007
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
16997
17008
  * for notes on _meta usage.
16998
17009
  */
16999
- _meta: external_exports.optional(external_exports.object({}).passthrough())
17000
- }).passthrough();
17010
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
17011
+ });
17001
17012
  var ImageContentSchema = external_exports.object({
17002
17013
  type: external_exports.literal("image"),
17003
17014
  /**
@@ -17012,8 +17023,8 @@ var ImageContentSchema = external_exports.object({
17012
17023
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
17013
17024
  * for notes on _meta usage.
17014
17025
  */
17015
- _meta: external_exports.optional(external_exports.object({}).passthrough())
17016
- }).passthrough();
17026
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
17027
+ });
17017
17028
  var AudioContentSchema = external_exports.object({
17018
17029
  type: external_exports.literal("audio"),
17019
17030
  /**
@@ -17028,8 +17039,8 @@ var AudioContentSchema = external_exports.object({
17028
17039
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
17029
17040
  * for notes on _meta usage.
17030
17041
  */
17031
- _meta: external_exports.optional(external_exports.object({}).passthrough())
17032
- }).passthrough();
17042
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
17043
+ });
17033
17044
  var EmbeddedResourceSchema = external_exports.object({
17034
17045
  type: external_exports.literal("resource"),
17035
17046
  resource: external_exports.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
@@ -17037,8 +17048,8 @@ var EmbeddedResourceSchema = external_exports.object({
17037
17048
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
17038
17049
  * for notes on _meta usage.
17039
17050
  */
17040
- _meta: external_exports.optional(external_exports.object({}).passthrough())
17041
- }).passthrough();
17051
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
17052
+ });
17042
17053
  var ResourceLinkSchema = ResourceSchema.extend({
17043
17054
  type: external_exports.literal("resource_link")
17044
17055
  });
@@ -17052,7 +17063,7 @@ var ContentBlockSchema = external_exports.union([
17052
17063
  var PromptMessageSchema = external_exports.object({
17053
17064
  role: external_exports.enum(["user", "assistant"]),
17054
17065
  content: ContentBlockSchema
17055
- }).passthrough();
17066
+ });
17056
17067
  var GetPromptResultSchema = ResultSchema.extend({
17057
17068
  /**
17058
17069
  * An optional description for the prompt.
@@ -17067,13 +17078,13 @@ var ToolAnnotationsSchema = external_exports.object({
17067
17078
  /**
17068
17079
  * A human-readable title for the tool.
17069
17080
  */
17070
- title: external_exports.optional(external_exports.string()),
17081
+ title: external_exports.string().optional(),
17071
17082
  /**
17072
17083
  * If true, the tool does not modify its environment.
17073
17084
  *
17074
17085
  * Default: false
17075
17086
  */
17076
- readOnlyHint: external_exports.optional(external_exports.boolean()),
17087
+ readOnlyHint: external_exports.boolean().optional(),
17077
17088
  /**
17078
17089
  * If true, the tool may perform destructive updates to its environment.
17079
17090
  * If false, the tool performs only additive updates.
@@ -17082,7 +17093,7 @@ var ToolAnnotationsSchema = external_exports.object({
17082
17093
  *
17083
17094
  * Default: true
17084
17095
  */
17085
- destructiveHint: external_exports.optional(external_exports.boolean()),
17096
+ destructiveHint: external_exports.boolean().optional(),
17086
17097
  /**
17087
17098
  * If true, calling the tool repeatedly with the same arguments
17088
17099
  * will have no additional effect on the its environment.
@@ -17091,7 +17102,7 @@ var ToolAnnotationsSchema = external_exports.object({
17091
17102
  *
17092
17103
  * Default: false
17093
17104
  */
17094
- idempotentHint: external_exports.optional(external_exports.boolean()),
17105
+ idempotentHint: external_exports.boolean().optional(),
17095
17106
  /**
17096
17107
  * If true, this tool may interact with an "open world" of external
17097
17108
  * entities. If false, the tool's domain of interaction is closed.
@@ -17100,30 +17111,34 @@ var ToolAnnotationsSchema = external_exports.object({
17100
17111
  *
17101
17112
  * Default: true
17102
17113
  */
17103
- openWorldHint: external_exports.optional(external_exports.boolean())
17104
- }).passthrough();
17114
+ openWorldHint: external_exports.boolean().optional()
17115
+ });
17105
17116
  var ToolSchema = BaseMetadataSchema.extend({
17106
17117
  /**
17107
17118
  * A human-readable description of the tool.
17108
17119
  */
17109
- description: external_exports.optional(external_exports.string()),
17120
+ description: external_exports.string().optional(),
17110
17121
  /**
17111
17122
  * A JSON Schema object defining the expected parameters for the tool.
17112
17123
  */
17113
17124
  inputSchema: external_exports.object({
17114
17125
  type: external_exports.literal("object"),
17115
- properties: external_exports.optional(external_exports.object({}).passthrough()),
17126
+ properties: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
17116
17127
  required: external_exports.optional(external_exports.array(external_exports.string()))
17117
- }).passthrough(),
17128
+ }),
17118
17129
  /**
17119
17130
  * An optional JSON Schema object defining the structure of the tool's output returned in
17120
17131
  * the structuredContent field of a CallToolResult.
17121
17132
  */
17122
- outputSchema: external_exports.optional(external_exports.object({
17133
+ outputSchema: external_exports.object({
17123
17134
  type: external_exports.literal("object"),
17124
- properties: external_exports.optional(external_exports.object({}).passthrough()),
17125
- required: external_exports.optional(external_exports.array(external_exports.string()))
17126
- }).passthrough()),
17135
+ properties: external_exports.record(external_exports.string(), AssertObjectSchema).optional(),
17136
+ required: external_exports.optional(external_exports.array(external_exports.string())),
17137
+ /**
17138
+ * Not in the MCP specification, but added to support the Ajv validator while removing .passthrough() which previously allowed additionalProperties to be passed through.
17139
+ */
17140
+ additionalProperties: external_exports.optional(external_exports.boolean())
17141
+ }).optional(),
17127
17142
  /**
17128
17143
  * Optional additional tool information.
17129
17144
  */
@@ -17132,7 +17147,7 @@ var ToolSchema = BaseMetadataSchema.extend({
17132
17147
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
17133
17148
  * for notes on _meta usage.
17134
17149
  */
17135
- _meta: external_exports.optional(external_exports.object({}).passthrough())
17150
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
17136
17151
  }).merge(IconsSchema);
17137
17152
  var ListToolsRequestSchema = PaginatedRequestSchema.extend({
17138
17153
  method: external_exports.literal("tools/list")
@@ -17153,7 +17168,7 @@ var CallToolResultSchema = ResultSchema.extend({
17153
17168
  *
17154
17169
  * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
17155
17170
  */
17156
- structuredContent: external_exports.object({}).passthrough().optional(),
17171
+ structuredContent: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
17157
17172
  /**
17158
17173
  * Whether the tool call ended in an error.
17159
17174
  *
@@ -17173,49 +17188,58 @@ var CallToolResultSchema = ResultSchema.extend({
17173
17188
  var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
17174
17189
  toolResult: external_exports.unknown()
17175
17190
  }));
17191
+ var CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
17192
+ /**
17193
+ * The name of the tool to call.
17194
+ */
17195
+ name: external_exports.string(),
17196
+ /**
17197
+ * Arguments to pass to the tool.
17198
+ */
17199
+ arguments: external_exports.optional(external_exports.record(external_exports.string(), external_exports.unknown()))
17200
+ });
17176
17201
  var CallToolRequestSchema = RequestSchema.extend({
17177
17202
  method: external_exports.literal("tools/call"),
17178
- params: BaseRequestParamsSchema.extend({
17179
- name: external_exports.string(),
17180
- arguments: external_exports.optional(external_exports.record(external_exports.unknown()))
17181
- })
17203
+ params: CallToolRequestParamsSchema
17182
17204
  });
17183
17205
  var ToolListChangedNotificationSchema = NotificationSchema.extend({
17184
17206
  method: external_exports.literal("notifications/tools/list_changed")
17185
17207
  });
17186
17208
  var LoggingLevelSchema = external_exports.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
17209
+ var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
17210
+ /**
17211
+ * 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.
17212
+ */
17213
+ level: LoggingLevelSchema
17214
+ });
17187
17215
  var SetLevelRequestSchema = RequestSchema.extend({
17188
17216
  method: external_exports.literal("logging/setLevel"),
17189
- params: BaseRequestParamsSchema.extend({
17190
- /**
17191
- * 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.
17192
- */
17193
- level: LoggingLevelSchema
17194
- })
17217
+ params: SetLevelRequestParamsSchema
17218
+ });
17219
+ var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
17220
+ /**
17221
+ * The severity of this log message.
17222
+ */
17223
+ level: LoggingLevelSchema,
17224
+ /**
17225
+ * An optional name of the logger issuing this message.
17226
+ */
17227
+ logger: external_exports.string().optional(),
17228
+ /**
17229
+ * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
17230
+ */
17231
+ data: external_exports.unknown()
17195
17232
  });
17196
17233
  var LoggingMessageNotificationSchema = NotificationSchema.extend({
17197
17234
  method: external_exports.literal("notifications/message"),
17198
- params: BaseNotificationParamsSchema.extend({
17199
- /**
17200
- * The severity of this log message.
17201
- */
17202
- level: LoggingLevelSchema,
17203
- /**
17204
- * An optional name of the logger issuing this message.
17205
- */
17206
- logger: external_exports.optional(external_exports.string()),
17207
- /**
17208
- * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
17209
- */
17210
- data: external_exports.unknown()
17211
- })
17235
+ params: LoggingMessageNotificationParamsSchema
17212
17236
  });
17213
17237
  var ModelHintSchema = external_exports.object({
17214
17238
  /**
17215
17239
  * A hint for a model name.
17216
17240
  */
17217
17241
  name: external_exports.string().optional()
17218
- }).passthrough();
17242
+ });
17219
17243
  var ModelPreferencesSchema = external_exports.object({
17220
17244
  /**
17221
17245
  * Optional hints to use for model selection.
@@ -17233,38 +17257,41 @@ var ModelPreferencesSchema = external_exports.object({
17233
17257
  * How much to prioritize intelligence and capabilities when selecting a model.
17234
17258
  */
17235
17259
  intelligencePriority: external_exports.optional(external_exports.number().min(0).max(1))
17236
- }).passthrough();
17260
+ });
17237
17261
  var SamplingMessageSchema = external_exports.object({
17238
17262
  role: external_exports.enum(["user", "assistant"]),
17239
17263
  content: external_exports.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
17240
- }).passthrough();
17264
+ });
17265
+ var CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
17266
+ messages: external_exports.array(SamplingMessageSchema),
17267
+ /**
17268
+ * The server's preferences for which model to select. The client MAY modify or omit this request.
17269
+ */
17270
+ modelPreferences: ModelPreferencesSchema.optional(),
17271
+ /**
17272
+ * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
17273
+ */
17274
+ systemPrompt: external_exports.string().optional(),
17275
+ /**
17276
+ * 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.
17277
+ */
17278
+ includeContext: external_exports.enum(["none", "thisServer", "allServers"]).optional(),
17279
+ temperature: external_exports.number().optional(),
17280
+ /**
17281
+ * The requested maximum number of tokens to sample (to prevent runaway completions).
17282
+ *
17283
+ * The client MAY choose to sample fewer tokens than the requested maximum.
17284
+ */
17285
+ maxTokens: external_exports.number().int(),
17286
+ stopSequences: external_exports.array(external_exports.string()).optional(),
17287
+ /**
17288
+ * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
17289
+ */
17290
+ metadata: AssertObjectSchema.optional()
17291
+ });
17241
17292
  var CreateMessageRequestSchema = RequestSchema.extend({
17242
17293
  method: external_exports.literal("sampling/createMessage"),
17243
- params: BaseRequestParamsSchema.extend({
17244
- messages: external_exports.array(SamplingMessageSchema),
17245
- /**
17246
- * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
17247
- */
17248
- systemPrompt: external_exports.optional(external_exports.string()),
17249
- /**
17250
- * 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.
17251
- */
17252
- includeContext: external_exports.optional(external_exports.enum(["none", "thisServer", "allServers"])),
17253
- temperature: external_exports.optional(external_exports.number()),
17254
- /**
17255
- * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
17256
- */
17257
- maxTokens: external_exports.number().int(),
17258
- stopSequences: external_exports.optional(external_exports.array(external_exports.string())),
17259
- /**
17260
- * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
17261
- */
17262
- metadata: external_exports.optional(external_exports.object({}).passthrough()),
17263
- /**
17264
- * The server's preferences for which model to select.
17265
- */
17266
- modelPreferences: external_exports.optional(ModelPreferencesSchema)
17267
- })
17294
+ params: CreateMessageRequestParamsSchema
17268
17295
  });
17269
17296
  var CreateMessageResultSchema = ResultSchema.extend({
17270
17297
  /**
@@ -17280,59 +17307,114 @@ var CreateMessageResultSchema = ResultSchema.extend({
17280
17307
  });
17281
17308
  var BooleanSchemaSchema = external_exports.object({
17282
17309
  type: external_exports.literal("boolean"),
17283
- title: external_exports.optional(external_exports.string()),
17284
- description: external_exports.optional(external_exports.string()),
17285
- default: external_exports.optional(external_exports.boolean())
17286
- }).passthrough();
17310
+ title: external_exports.string().optional(),
17311
+ description: external_exports.string().optional(),
17312
+ default: external_exports.boolean().optional()
17313
+ });
17287
17314
  var StringSchemaSchema = external_exports.object({
17288
17315
  type: external_exports.literal("string"),
17289
- title: external_exports.optional(external_exports.string()),
17290
- description: external_exports.optional(external_exports.string()),
17291
- minLength: external_exports.optional(external_exports.number()),
17292
- maxLength: external_exports.optional(external_exports.number()),
17293
- format: external_exports.optional(external_exports.enum(["email", "uri", "date", "date-time"]))
17294
- }).passthrough();
17316
+ title: external_exports.string().optional(),
17317
+ description: external_exports.string().optional(),
17318
+ minLength: external_exports.number().optional(),
17319
+ maxLength: external_exports.number().optional(),
17320
+ format: external_exports.enum(["email", "uri", "date", "date-time"]).optional(),
17321
+ default: external_exports.string().optional()
17322
+ });
17295
17323
  var NumberSchemaSchema = external_exports.object({
17296
17324
  type: external_exports.enum(["number", "integer"]),
17297
- title: external_exports.optional(external_exports.string()),
17298
- description: external_exports.optional(external_exports.string()),
17299
- minimum: external_exports.optional(external_exports.number()),
17300
- maximum: external_exports.optional(external_exports.number())
17301
- }).passthrough();
17302
- var EnumSchemaSchema = external_exports.object({
17325
+ title: external_exports.string().optional(),
17326
+ description: external_exports.string().optional(),
17327
+ minimum: external_exports.number().optional(),
17328
+ maximum: external_exports.number().optional(),
17329
+ default: external_exports.number().optional()
17330
+ });
17331
+ var UntitledSingleSelectEnumSchemaSchema = external_exports.object({
17303
17332
  type: external_exports.literal("string"),
17304
- title: external_exports.optional(external_exports.string()),
17305
- description: external_exports.optional(external_exports.string()),
17333
+ title: external_exports.string().optional(),
17334
+ description: external_exports.string().optional(),
17306
17335
  enum: external_exports.array(external_exports.string()),
17307
- enumNames: external_exports.optional(external_exports.array(external_exports.string()))
17308
- }).passthrough();
17309
- var PrimitiveSchemaDefinitionSchema = external_exports.union([BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema]);
17336
+ default: external_exports.string().optional()
17337
+ });
17338
+ var TitledSingleSelectEnumSchemaSchema = external_exports.object({
17339
+ type: external_exports.literal("string"),
17340
+ title: external_exports.string().optional(),
17341
+ description: external_exports.string().optional(),
17342
+ oneOf: external_exports.array(external_exports.object({
17343
+ const: external_exports.string(),
17344
+ title: external_exports.string()
17345
+ })),
17346
+ default: external_exports.string().optional()
17347
+ });
17348
+ var LegacyTitledEnumSchemaSchema = external_exports.object({
17349
+ type: external_exports.literal("string"),
17350
+ title: external_exports.string().optional(),
17351
+ description: external_exports.string().optional(),
17352
+ enum: external_exports.array(external_exports.string()),
17353
+ enumNames: external_exports.array(external_exports.string()).optional(),
17354
+ default: external_exports.string().optional()
17355
+ });
17356
+ var SingleSelectEnumSchemaSchema = external_exports.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
17357
+ var UntitledMultiSelectEnumSchemaSchema = external_exports.object({
17358
+ type: external_exports.literal("array"),
17359
+ title: external_exports.string().optional(),
17360
+ description: external_exports.string().optional(),
17361
+ minItems: external_exports.number().optional(),
17362
+ maxItems: external_exports.number().optional(),
17363
+ items: external_exports.object({
17364
+ type: external_exports.literal("string"),
17365
+ enum: external_exports.array(external_exports.string())
17366
+ }),
17367
+ default: external_exports.array(external_exports.string()).optional()
17368
+ });
17369
+ var TitledMultiSelectEnumSchemaSchema = external_exports.object({
17370
+ type: external_exports.literal("array"),
17371
+ title: external_exports.string().optional(),
17372
+ description: external_exports.string().optional(),
17373
+ minItems: external_exports.number().optional(),
17374
+ maxItems: external_exports.number().optional(),
17375
+ items: external_exports.object({
17376
+ anyOf: external_exports.array(external_exports.object({
17377
+ const: external_exports.string(),
17378
+ title: external_exports.string()
17379
+ }))
17380
+ }),
17381
+ default: external_exports.array(external_exports.string()).optional()
17382
+ });
17383
+ var MultiSelectEnumSchemaSchema = external_exports.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
17384
+ var EnumSchemaSchema = external_exports.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
17385
+ var PrimitiveSchemaDefinitionSchema = external_exports.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
17386
+ var ElicitRequestParamsSchema = BaseRequestParamsSchema.extend({
17387
+ /**
17388
+ * The message to present to the user.
17389
+ */
17390
+ message: external_exports.string(),
17391
+ /**
17392
+ * A restricted subset of JSON Schema.
17393
+ * Only top-level properties are allowed, without nesting.
17394
+ */
17395
+ requestedSchema: external_exports.object({
17396
+ type: external_exports.literal("object"),
17397
+ properties: external_exports.record(external_exports.string(), PrimitiveSchemaDefinitionSchema),
17398
+ required: external_exports.array(external_exports.string()).optional()
17399
+ })
17400
+ });
17310
17401
  var ElicitRequestSchema = RequestSchema.extend({
17311
17402
  method: external_exports.literal("elicitation/create"),
17312
- params: BaseRequestParamsSchema.extend({
17313
- /**
17314
- * The message to present to the user.
17315
- */
17316
- message: external_exports.string(),
17317
- /**
17318
- * The schema for the requested user input.
17319
- */
17320
- requestedSchema: external_exports.object({
17321
- type: external_exports.literal("object"),
17322
- properties: external_exports.record(external_exports.string(), PrimitiveSchemaDefinitionSchema),
17323
- required: external_exports.optional(external_exports.array(external_exports.string()))
17324
- }).passthrough()
17325
- })
17403
+ params: ElicitRequestParamsSchema
17326
17404
  });
17327
17405
  var ElicitResultSchema = ResultSchema.extend({
17328
17406
  /**
17329
- * The user's response action.
17407
+ * The user action in response to the elicitation.
17408
+ * - "accept": User submitted the form/confirmed the action
17409
+ * - "decline": User explicitly decline the action
17410
+ * - "cancel": User dismissed without making an explicit choice
17330
17411
  */
17331
17412
  action: external_exports.enum(["accept", "decline", "cancel"]),
17332
17413
  /**
17333
- * The collected user input content (only present if action is "accept").
17414
+ * The submitted form data, only present when action is "accept".
17415
+ * Contains values matching the requested schema.
17334
17416
  */
17335
- content: external_exports.optional(external_exports.record(external_exports.string(), external_exports.unknown()))
17417
+ content: external_exports.record(external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), external_exports.array(external_exports.string())])).optional()
17336
17418
  });
17337
17419
  var ResourceTemplateReferenceSchema = external_exports.object({
17338
17420
  type: external_exports.literal("ref/resource"),
@@ -17340,39 +17422,50 @@ var ResourceTemplateReferenceSchema = external_exports.object({
17340
17422
  * The URI or URI template of the resource.
17341
17423
  */
17342
17424
  uri: external_exports.string()
17343
- }).passthrough();
17425
+ });
17344
17426
  var PromptReferenceSchema = external_exports.object({
17345
17427
  type: external_exports.literal("ref/prompt"),
17346
17428
  /**
17347
17429
  * The name of the prompt or prompt template
17348
17430
  */
17349
17431
  name: external_exports.string()
17350
- }).passthrough();
17351
- var CompleteRequestSchema = RequestSchema.extend({
17352
- method: external_exports.literal("completion/complete"),
17353
- params: BaseRequestParamsSchema.extend({
17354
- ref: external_exports.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
17432
+ });
17433
+ var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
17434
+ ref: external_exports.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
17435
+ /**
17436
+ * The argument's information
17437
+ */
17438
+ argument: external_exports.object({
17355
17439
  /**
17356
- * The argument's information
17440
+ * The name of the argument
17357
17441
  */
17358
- argument: external_exports.object({
17359
- /**
17360
- * The name of the argument
17361
- */
17362
- name: external_exports.string(),
17363
- /**
17364
- * The value of the argument to use for completion matching.
17365
- */
17366
- value: external_exports.string()
17367
- }).passthrough(),
17368
- context: external_exports.optional(external_exports.object({
17369
- /**
17370
- * Previously-resolved variables in a URI template or prompt.
17371
- */
17372
- arguments: external_exports.optional(external_exports.record(external_exports.string(), external_exports.string()))
17373
- }))
17374
- })
17442
+ name: external_exports.string(),
17443
+ /**
17444
+ * The value of the argument to use for completion matching.
17445
+ */
17446
+ value: external_exports.string()
17447
+ }),
17448
+ context: external_exports.object({
17449
+ /**
17450
+ * Previously-resolved variables in a URI template or prompt.
17451
+ */
17452
+ arguments: external_exports.record(external_exports.string(), external_exports.string()).optional()
17453
+ }).optional()
17375
17454
  });
17455
+ var CompleteRequestSchema = RequestSchema.extend({
17456
+ method: external_exports.literal("completion/complete"),
17457
+ params: CompleteRequestParamsSchema
17458
+ });
17459
+ function assertCompleteRequestPrompt(request) {
17460
+ if (request.params.ref.type !== "ref/prompt") {
17461
+ throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
17462
+ }
17463
+ }
17464
+ function assertCompleteRequestResourceTemplate(request) {
17465
+ if (request.params.ref.type !== "ref/resource") {
17466
+ throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);
17467
+ }
17468
+ }
17376
17469
  var CompleteResultSchema = ResultSchema.extend({
17377
17470
  completion: external_exports.object({
17378
17471
  /**
@@ -17397,13 +17490,13 @@ var RootSchema = external_exports.object({
17397
17490
  /**
17398
17491
  * An optional name for the root.
17399
17492
  */
17400
- name: external_exports.optional(external_exports.string()),
17493
+ name: external_exports.string().optional(),
17401
17494
  /**
17402
17495
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
17403
17496
  * for notes on _meta usage.
17404
17497
  */
17405
- _meta: external_exports.optional(external_exports.object({}).passthrough())
17406
- }).passthrough();
17498
+ _meta: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
17499
+ });
17407
17500
  var ListRootsRequestSchema = RequestSchema.extend({
17408
17501
  method: external_exports.literal("roots/list")
17409
17502
  });
@@ -17928,15 +18021,24 @@ var Protocol = class {
17928
18021
  this._notificationHandlers.delete(method);
17929
18022
  }
17930
18023
  };
18024
+ function isPlainObject(value) {
18025
+ return value !== null && typeof value === "object" && !Array.isArray(value);
18026
+ }
17931
18027
  function mergeCapabilities(base, additional) {
17932
- return Object.entries(additional).reduce((acc, [key, value]) => {
17933
- if (value && typeof value === "object") {
17934
- acc[key] = acc[key] ? { ...acc[key], ...value } : value;
18028
+ const result = { ...base };
18029
+ for (const key in additional) {
18030
+ const k = key;
18031
+ const addValue = additional[k];
18032
+ if (addValue === void 0)
18033
+ continue;
18034
+ const baseValue = result[k];
18035
+ if (isPlainObject(baseValue) && isPlainObject(addValue)) {
18036
+ result[k] = { ...baseValue, ...addValue };
17935
18037
  } else {
17936
- acc[key] = value;
18038
+ result[k] = addValue;
17937
18039
  }
17938
- return acc;
17939
- }, { ...base });
18040
+ }
18041
+ return result;
17940
18042
  }
17941
18043
 
17942
18044
  // node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
@@ -18108,9 +18210,9 @@ var Server = class extends Protocol {
18108
18210
  }
18109
18211
  assertRequestHandlerCapability(method) {
18110
18212
  switch (method) {
18111
- case "sampling/createMessage":
18112
- if (!this._capabilities.sampling) {
18113
- throw new Error(`Server does not support sampling (required for ${method})`);
18213
+ case "completion/complete":
18214
+ if (!this._capabilities.completions) {
18215
+ throw new Error(`Server does not support completions (required for ${method})`);
18114
18216
  }
18115
18217
  break;
18116
18218
  case "logging/setLevel":
@@ -19565,6 +19667,64 @@ function processCreateParams2(params) {
19565
19667
  return { errorMap: customMap, description };
19566
19668
  }
19567
19669
 
19670
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
19671
+ var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
19672
+ function validateToolName(name) {
19673
+ const warnings = [];
19674
+ if (name.length === 0) {
19675
+ return {
19676
+ isValid: false,
19677
+ warnings: ["Tool name cannot be empty"]
19678
+ };
19679
+ }
19680
+ if (name.length > 128) {
19681
+ return {
19682
+ isValid: false,
19683
+ warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]
19684
+ };
19685
+ }
19686
+ if (name.includes(" ")) {
19687
+ warnings.push("Tool name contains spaces, which may cause parsing issues");
19688
+ }
19689
+ if (name.includes(",")) {
19690
+ warnings.push("Tool name contains commas, which may cause parsing issues");
19691
+ }
19692
+ if (name.startsWith("-") || name.endsWith("-")) {
19693
+ warnings.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");
19694
+ }
19695
+ if (name.startsWith(".") || name.endsWith(".")) {
19696
+ warnings.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");
19697
+ }
19698
+ if (!TOOL_NAME_REGEX.test(name)) {
19699
+ const invalidChars = name.split("").filter((char) => !/[A-Za-z0-9._-]/.test(char)).filter((char, index, arr) => arr.indexOf(char) === index);
19700
+ 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 (.)");
19701
+ return {
19702
+ isValid: false,
19703
+ warnings
19704
+ };
19705
+ }
19706
+ return {
19707
+ isValid: true,
19708
+ warnings
19709
+ };
19710
+ }
19711
+ function issueToolNameWarning(name, warnings) {
19712
+ if (warnings.length > 0) {
19713
+ console.warn(`Tool name validation warning for "${name}":`);
19714
+ for (const warning of warnings) {
19715
+ console.warn(` - ${warning}`);
19716
+ }
19717
+ console.warn("Tool registration will proceed, but this may cause compatibility issues.");
19718
+ console.warn("Consider updating the tool name to conform to the MCP tool naming standard.");
19719
+ console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.");
19720
+ }
19721
+ }
19722
+ function validateAndWarnToolName(name) {
19723
+ const result = validateToolName(name);
19724
+ issueToolNameWarning(name, result.warnings);
19725
+ return result.isValid;
19726
+ }
19727
+
19568
19728
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
19569
19729
  var McpServer = class {
19570
19730
  constructor(serverInfo, options) {
@@ -19691,8 +19851,10 @@ var McpServer = class {
19691
19851
  this.server.setRequestHandler(CompleteRequestSchema, async (request) => {
19692
19852
  switch (request.params.ref.type) {
19693
19853
  case "ref/prompt":
19854
+ assertCompleteRequestPrompt(request);
19694
19855
  return this.handlePromptCompletion(request, request.params.ref);
19695
19856
  case "ref/resource":
19857
+ assertCompleteRequestResourceTemplate(request);
19696
19858
  return this.handleResourceCompletion(request, request.params.ref);
19697
19859
  default:
19698
19860
  throw new McpError(ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`);
@@ -19981,11 +20143,12 @@ var McpServer = class {
19981
20143
  return registeredPrompt;
19982
20144
  }
19983
20145
  _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, _meta, callback) {
20146
+ validateAndWarnToolName(name);
19984
20147
  const registeredTool = {
19985
20148
  title,
19986
20149
  description,
19987
- inputSchema: inputSchema === void 0 ? void 0 : external_exports.object(inputSchema),
19988
- outputSchema: outputSchema === void 0 ? void 0 : external_exports.object(outputSchema),
20150
+ inputSchema: getZodSchemaObject(inputSchema),
20151
+ outputSchema: getZodSchemaObject(outputSchema),
19989
20152
  annotations,
19990
20153
  _meta,
19991
20154
  callback,
@@ -19995,6 +20158,9 @@ var McpServer = class {
19995
20158
  remove: () => registeredTool.update({ name: null }),
19996
20159
  update: (updates) => {
19997
20160
  if (typeof updates.name !== "undefined" && updates.name !== name) {
20161
+ if (typeof updates.name === "string") {
20162
+ validateAndWarnToolName(updates.name);
20163
+ }
19998
20164
  delete this._registeredTools[name];
19999
20165
  if (updates.name)
20000
20166
  this._registeredTools[updates.name] = registeredTool;
@@ -20145,6 +20311,15 @@ function isZodRawShape(obj) {
20145
20311
  function isZodTypeLike(value) {
20146
20312
  return value !== null && typeof value === "object" && "parse" in value && typeof value.parse === "function" && "safeParse" in value && typeof value.safeParse === "function";
20147
20313
  }
20314
+ function getZodSchemaObject(schema) {
20315
+ if (!schema) {
20316
+ return void 0;
20317
+ }
20318
+ if (isZodRawShape(schema)) {
20319
+ return external_exports.object(schema);
20320
+ }
20321
+ return schema;
20322
+ }
20148
20323
  function promptArgumentsFromSchema(schema) {
20149
20324
  return Object.entries(schema.shape).map(([name, field]) => ({
20150
20325
  name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kentico/management-api-mcp",
3
- "version": "30.12.0-preview",
3
+ "version": "30.12.1-preview",
4
4
  "description": "Model Context Protocol server for Xperience by Kentico Management API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",