tmcp 1.7.1 → 1.8.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/package.json +1 -1
- package/src/index.d.ts +3 -13
- package/src/validation/index.d.ts +431 -431
- package/src/validation/index.js +113 -113
package/src/validation/index.js
CHANGED
|
@@ -62,7 +62,7 @@ export const NotificationSchema = v.object({
|
|
|
62
62
|
method: v.string(),
|
|
63
63
|
params: v.optional(BaseNotificationParamsSchema),
|
|
64
64
|
});
|
|
65
|
-
export const ResultSchema = v.
|
|
65
|
+
export const ResultSchema = v.object({
|
|
66
66
|
/**
|
|
67
67
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
68
68
|
* for notes on _meta usage.
|
|
@@ -150,10 +150,10 @@ export const EmptyResultSchema = v.strictObject({ ...ResultSchema.entries });
|
|
|
150
150
|
*
|
|
151
151
|
* A client MUST NOT attempt to cancel its `initialize` request.
|
|
152
152
|
*/
|
|
153
|
-
export const CancelledNotificationSchema = v.
|
|
153
|
+
export const CancelledNotificationSchema = v.object({
|
|
154
154
|
...NotificationSchema.entries,
|
|
155
155
|
method: v.literal('notifications/cancelled'),
|
|
156
|
-
params: v.
|
|
156
|
+
params: v.object({
|
|
157
157
|
...BaseNotificationParamsSchema.entries,
|
|
158
158
|
|
|
159
159
|
/**
|
|
@@ -174,7 +174,7 @@ export const CancelledNotificationSchema = v.looseObject({
|
|
|
174
174
|
/**
|
|
175
175
|
* Base metadata interface for common properties across resources, tools, prompts, and implementations.
|
|
176
176
|
*/
|
|
177
|
-
export const BaseMetadataSchema = v.
|
|
177
|
+
export const BaseMetadataSchema = v.object({
|
|
178
178
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
179
179
|
name: v.string(),
|
|
180
180
|
|
|
@@ -193,7 +193,7 @@ export const BaseMetadataSchema = v.looseObject({
|
|
|
193
193
|
/**
|
|
194
194
|
* Describes the name and version of an MCP implementation.
|
|
195
195
|
*/
|
|
196
|
-
export const ImplementationSchema = v.
|
|
196
|
+
export const ImplementationSchema = v.object({
|
|
197
197
|
...BaseMetadataSchema.entries,
|
|
198
198
|
version: v.string(),
|
|
199
199
|
});
|
|
@@ -201,27 +201,27 @@ export const ImplementationSchema = v.looseObject({
|
|
|
201
201
|
/**
|
|
202
202
|
* Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
|
|
203
203
|
*/
|
|
204
|
-
export const ClientCapabilitiesSchema = v.
|
|
204
|
+
export const ClientCapabilitiesSchema = v.object({
|
|
205
205
|
/**
|
|
206
206
|
* Experimental, non-standard capabilities that the client supports.
|
|
207
207
|
*/
|
|
208
|
-
experimental: v.optional(v.
|
|
208
|
+
experimental: v.optional(v.object({})),
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
211
|
* Present if the client supports sampling from an LLM.
|
|
212
212
|
*/
|
|
213
|
-
sampling: v.optional(v.
|
|
213
|
+
sampling: v.optional(v.object({})),
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
216
|
* Present if the client supports eliciting user input.
|
|
217
217
|
*/
|
|
218
|
-
elicitation: v.optional(v.
|
|
218
|
+
elicitation: v.optional(v.object({})),
|
|
219
219
|
|
|
220
220
|
/**
|
|
221
221
|
* Present if the client supports listing roots.
|
|
222
222
|
*/
|
|
223
223
|
roots: v.optional(
|
|
224
|
-
v.
|
|
224
|
+
v.object({
|
|
225
225
|
/**
|
|
226
226
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
227
227
|
*/
|
|
@@ -230,7 +230,7 @@ export const ClientCapabilitiesSchema = v.looseObject({
|
|
|
230
230
|
),
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
export const InitializeRequestParamsSchema = v.
|
|
233
|
+
export const InitializeRequestParamsSchema = v.object({
|
|
234
234
|
...BaseRequestParamsSchema.entries,
|
|
235
235
|
|
|
236
236
|
/**
|
|
@@ -244,7 +244,7 @@ export const InitializeRequestParamsSchema = v.looseObject({
|
|
|
244
244
|
/**
|
|
245
245
|
* This request is sent from the client to the server when it first connects, asking it to begin initialization.
|
|
246
246
|
*/
|
|
247
|
-
export const InitializeRequestSchema = v.
|
|
247
|
+
export const InitializeRequestSchema = v.object({
|
|
248
248
|
...RequestSchema.entries,
|
|
249
249
|
method: v.literal('initialize'),
|
|
250
250
|
params: InitializeRequestParamsSchema,
|
|
@@ -253,27 +253,27 @@ export const InitializeRequestSchema = v.looseObject({
|
|
|
253
253
|
/**
|
|
254
254
|
* Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
|
|
255
255
|
*/
|
|
256
|
-
export const ServerCapabilitiesSchema = v.
|
|
256
|
+
export const ServerCapabilitiesSchema = v.object({
|
|
257
257
|
/**
|
|
258
258
|
* Experimental, non-standard capabilities that the server supports.
|
|
259
259
|
*/
|
|
260
|
-
experimental: v.optional(v.
|
|
260
|
+
experimental: v.optional(v.object({})),
|
|
261
261
|
|
|
262
262
|
/**
|
|
263
263
|
* Present if the server supports sending log messages to the client.
|
|
264
264
|
*/
|
|
265
|
-
logging: v.optional(v.
|
|
265
|
+
logging: v.optional(v.object({})),
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* Present if the server supports sending completions to the client.
|
|
269
269
|
*/
|
|
270
|
-
completions: v.optional(v.
|
|
270
|
+
completions: v.optional(v.object({})),
|
|
271
271
|
|
|
272
272
|
/**
|
|
273
273
|
* Present if the server offers any prompt templates.
|
|
274
274
|
*/
|
|
275
275
|
prompts: v.optional(
|
|
276
|
-
v.
|
|
276
|
+
v.object({
|
|
277
277
|
/**
|
|
278
278
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
279
279
|
*/
|
|
@@ -285,7 +285,7 @@ export const ServerCapabilitiesSchema = v.looseObject({
|
|
|
285
285
|
* Present if the server offers any resources to read.
|
|
286
286
|
*/
|
|
287
287
|
resources: v.optional(
|
|
288
|
-
v.
|
|
288
|
+
v.object({
|
|
289
289
|
/**
|
|
290
290
|
* Whether this server supports clients subscribing to resource updates.
|
|
291
291
|
*/
|
|
@@ -302,7 +302,7 @@ export const ServerCapabilitiesSchema = v.looseObject({
|
|
|
302
302
|
* Present if the server offers any tools to call.
|
|
303
303
|
*/
|
|
304
304
|
tools: v.optional(
|
|
305
|
-
v.
|
|
305
|
+
v.object({
|
|
306
306
|
/**
|
|
307
307
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
308
308
|
*/
|
|
@@ -314,7 +314,7 @@ export const ServerCapabilitiesSchema = v.looseObject({
|
|
|
314
314
|
/**
|
|
315
315
|
* After receiving an initialize request from the client, the server sends this response.
|
|
316
316
|
*/
|
|
317
|
-
export const InitializeResultSchema = v.
|
|
317
|
+
export const InitializeResultSchema = v.object({
|
|
318
318
|
...ResultSchema.entries,
|
|
319
319
|
|
|
320
320
|
/**
|
|
@@ -335,7 +335,7 @@ export const InitializeResultSchema = v.looseObject({
|
|
|
335
335
|
/**
|
|
336
336
|
* This notification is sent from the client to the server after initialization has finished.
|
|
337
337
|
*/
|
|
338
|
-
export const InitializedNotificationSchema = v.
|
|
338
|
+
export const InitializedNotificationSchema = v.object({
|
|
339
339
|
...NotificationSchema.entries,
|
|
340
340
|
method: v.literal('notifications/initialized'),
|
|
341
341
|
});
|
|
@@ -344,12 +344,12 @@ export const InitializedNotificationSchema = v.looseObject({
|
|
|
344
344
|
/**
|
|
345
345
|
* A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
|
|
346
346
|
*/
|
|
347
|
-
export const PingRequestSchema = v.
|
|
347
|
+
export const PingRequestSchema = v.object({
|
|
348
348
|
...RequestSchema.entries,
|
|
349
349
|
method: v.literal('ping'),
|
|
350
350
|
});
|
|
351
351
|
/* Progress notifications */
|
|
352
|
-
export const ProgressSchema = v.
|
|
352
|
+
export const ProgressSchema = v.object({
|
|
353
353
|
/**
|
|
354
354
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
355
355
|
*/
|
|
@@ -369,7 +369,7 @@ export const ProgressSchema = v.looseObject({
|
|
|
369
369
|
/**
|
|
370
370
|
* An out-of-band notification used to inform the receiver of a progress update for a long-running request.
|
|
371
371
|
*/
|
|
372
|
-
export const ProgressNotificationSchema = v.
|
|
372
|
+
export const ProgressNotificationSchema = v.object({
|
|
373
373
|
...NotificationSchema.entries,
|
|
374
374
|
method: v.literal('notifications/progress'),
|
|
375
375
|
params: v.object({
|
|
@@ -383,10 +383,10 @@ export const ProgressNotificationSchema = v.looseObject({
|
|
|
383
383
|
}),
|
|
384
384
|
});
|
|
385
385
|
/* Pagination */
|
|
386
|
-
export const PaginatedRequestSchema = v.
|
|
386
|
+
export const PaginatedRequestSchema = v.object({
|
|
387
387
|
...RequestSchema.entries,
|
|
388
388
|
params: v.optional(
|
|
389
|
-
v.
|
|
389
|
+
v.object({
|
|
390
390
|
...BaseRequestParamsSchema.entries,
|
|
391
391
|
|
|
392
392
|
/**
|
|
@@ -397,7 +397,7 @@ export const PaginatedRequestSchema = v.looseObject({
|
|
|
397
397
|
}),
|
|
398
398
|
),
|
|
399
399
|
});
|
|
400
|
-
export const PaginatedResultSchema = v.
|
|
400
|
+
export const PaginatedResultSchema = v.object({
|
|
401
401
|
...ResultSchema.entries,
|
|
402
402
|
|
|
403
403
|
/**
|
|
@@ -411,7 +411,7 @@ export const PaginatedResultSchema = v.looseObject({
|
|
|
411
411
|
/**
|
|
412
412
|
* The contents of a specific resource or sub-resource.
|
|
413
413
|
*/
|
|
414
|
-
export const ResourceContentsSchema = v.
|
|
414
|
+
export const ResourceContentsSchema = v.object({
|
|
415
415
|
/**
|
|
416
416
|
* The URI of this resource.
|
|
417
417
|
*/
|
|
@@ -426,9 +426,9 @@ export const ResourceContentsSchema = v.looseObject({
|
|
|
426
426
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
427
427
|
* for notes on _meta usage.
|
|
428
428
|
*/
|
|
429
|
-
_meta: v.optional(v.
|
|
429
|
+
_meta: v.optional(v.object({})),
|
|
430
430
|
});
|
|
431
|
-
export const TextResourceContentsSchema = v.
|
|
431
|
+
export const TextResourceContentsSchema = v.object({
|
|
432
432
|
...ResourceContentsSchema.entries,
|
|
433
433
|
|
|
434
434
|
/**
|
|
@@ -436,7 +436,7 @@ export const TextResourceContentsSchema = v.looseObject({
|
|
|
436
436
|
*/
|
|
437
437
|
text: v.string(),
|
|
438
438
|
});
|
|
439
|
-
export const BlobResourceContentsSchema = v.
|
|
439
|
+
export const BlobResourceContentsSchema = v.object({
|
|
440
440
|
...ResourceContentsSchema.entries,
|
|
441
441
|
|
|
442
442
|
/**
|
|
@@ -448,7 +448,7 @@ export const BlobResourceContentsSchema = v.looseObject({
|
|
|
448
448
|
/**
|
|
449
449
|
* A known resource that the server is capable of reading.
|
|
450
450
|
*/
|
|
451
|
-
export const ResourceSchema = v.
|
|
451
|
+
export const ResourceSchema = v.object({
|
|
452
452
|
...BaseMetadataSchema.entries,
|
|
453
453
|
|
|
454
454
|
/**
|
|
@@ -472,13 +472,13 @@ export const ResourceSchema = v.looseObject({
|
|
|
472
472
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
473
473
|
* for notes on _meta usage.
|
|
474
474
|
*/
|
|
475
|
-
_meta: v.optional(v.
|
|
475
|
+
_meta: v.optional(v.object({})),
|
|
476
476
|
});
|
|
477
477
|
|
|
478
478
|
/**
|
|
479
479
|
* A template description for resources available on the server.
|
|
480
480
|
*/
|
|
481
|
-
export const ResourceTemplateSchema = v.
|
|
481
|
+
export const ResourceTemplateSchema = v.object({
|
|
482
482
|
...BaseMetadataSchema.entries,
|
|
483
483
|
|
|
484
484
|
/**
|
|
@@ -502,13 +502,13 @@ export const ResourceTemplateSchema = v.looseObject({
|
|
|
502
502
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
503
503
|
* for notes on _meta usage.
|
|
504
504
|
*/
|
|
505
|
-
_meta: v.optional(v.
|
|
505
|
+
_meta: v.optional(v.object({})),
|
|
506
506
|
});
|
|
507
507
|
|
|
508
508
|
/**
|
|
509
509
|
* Sent from the client to request a list of resources the server has.
|
|
510
510
|
*/
|
|
511
|
-
export const ListResourcesRequestSchema = v.
|
|
511
|
+
export const ListResourcesRequestSchema = v.object({
|
|
512
512
|
...PaginatedRequestSchema.entries,
|
|
513
513
|
method: v.literal('resources/list'),
|
|
514
514
|
});
|
|
@@ -516,7 +516,7 @@ export const ListResourcesRequestSchema = v.looseObject({
|
|
|
516
516
|
/**
|
|
517
517
|
* The server's response to a resources/list request from the client.
|
|
518
518
|
*/
|
|
519
|
-
export const ListResourcesResultSchema = v.
|
|
519
|
+
export const ListResourcesResultSchema = v.object({
|
|
520
520
|
...PaginatedResultSchema.entries,
|
|
521
521
|
resources: v.array(ResourceSchema),
|
|
522
522
|
});
|
|
@@ -524,7 +524,7 @@ export const ListResourcesResultSchema = v.looseObject({
|
|
|
524
524
|
/**
|
|
525
525
|
* Sent from the client to request a list of resource templates the server has.
|
|
526
526
|
*/
|
|
527
|
-
export const ListResourceTemplatesRequestSchema = v.
|
|
527
|
+
export const ListResourceTemplatesRequestSchema = v.object({
|
|
528
528
|
...PaginatedRequestSchema.entries,
|
|
529
529
|
method: v.literal('resources/templates/list'),
|
|
530
530
|
});
|
|
@@ -532,7 +532,7 @@ export const ListResourceTemplatesRequestSchema = v.looseObject({
|
|
|
532
532
|
/**
|
|
533
533
|
* The server's response to a resources/templates/list request from the client.
|
|
534
534
|
*/
|
|
535
|
-
export const ListResourceTemplatesResultSchema = v.
|
|
535
|
+
export const ListResourceTemplatesResultSchema = v.object({
|
|
536
536
|
...PaginatedResultSchema.entries,
|
|
537
537
|
resourceTemplates: v.array(ResourceTemplateSchema),
|
|
538
538
|
});
|
|
@@ -540,10 +540,10 @@ export const ListResourceTemplatesResultSchema = v.looseObject({
|
|
|
540
540
|
/**
|
|
541
541
|
* Sent from the client to the server, to read a specific resource URI.
|
|
542
542
|
*/
|
|
543
|
-
export const ReadResourceRequestSchema = v.
|
|
543
|
+
export const ReadResourceRequestSchema = v.object({
|
|
544
544
|
...RequestSchema.entries,
|
|
545
545
|
method: v.literal('resources/read'),
|
|
546
|
-
params: v.
|
|
546
|
+
params: v.object({
|
|
547
547
|
...BaseRequestParamsSchema.entries,
|
|
548
548
|
|
|
549
549
|
/**
|
|
@@ -556,7 +556,7 @@ export const ReadResourceRequestSchema = v.looseObject({
|
|
|
556
556
|
/**
|
|
557
557
|
* The server's response to a resources/read request from the client.
|
|
558
558
|
*/
|
|
559
|
-
export const ReadResourceResultSchema = v.
|
|
559
|
+
export const ReadResourceResultSchema = v.object({
|
|
560
560
|
...ResultSchema.entries,
|
|
561
561
|
contents: v.array(
|
|
562
562
|
v.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
@@ -566,7 +566,7 @@ export const ReadResourceResultSchema = v.looseObject({
|
|
|
566
566
|
/**
|
|
567
567
|
* An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
|
|
568
568
|
*/
|
|
569
|
-
export const ResourceListChangedNotificationSchema = v.
|
|
569
|
+
export const ResourceListChangedNotificationSchema = v.object({
|
|
570
570
|
...NotificationSchema.entries,
|
|
571
571
|
method: v.literal('notifications/resources/list_changed'),
|
|
572
572
|
});
|
|
@@ -574,10 +574,10 @@ export const ResourceListChangedNotificationSchema = v.looseObject({
|
|
|
574
574
|
/**
|
|
575
575
|
* Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
|
|
576
576
|
*/
|
|
577
|
-
export const SubscribeRequestSchema = v.
|
|
577
|
+
export const SubscribeRequestSchema = v.object({
|
|
578
578
|
...RequestSchema.entries,
|
|
579
579
|
method: v.literal('resources/subscribe'),
|
|
580
|
-
params: v.
|
|
580
|
+
params: v.object({
|
|
581
581
|
...BaseRequestParamsSchema.entries,
|
|
582
582
|
|
|
583
583
|
/**
|
|
@@ -590,10 +590,10 @@ export const SubscribeRequestSchema = v.looseObject({
|
|
|
590
590
|
/**
|
|
591
591
|
* Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
|
|
592
592
|
*/
|
|
593
|
-
export const UnsubscribeRequestSchema = v.
|
|
593
|
+
export const UnsubscribeRequestSchema = v.object({
|
|
594
594
|
...RequestSchema.entries,
|
|
595
595
|
method: v.literal('resources/unsubscribe'),
|
|
596
|
-
params: v.
|
|
596
|
+
params: v.object({
|
|
597
597
|
...BaseRequestParamsSchema.entries,
|
|
598
598
|
|
|
599
599
|
/**
|
|
@@ -606,10 +606,10 @@ export const UnsubscribeRequestSchema = v.looseObject({
|
|
|
606
606
|
/**
|
|
607
607
|
* A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
|
|
608
608
|
*/
|
|
609
|
-
export const ResourceUpdatedNotificationSchema = v.
|
|
609
|
+
export const ResourceUpdatedNotificationSchema = v.object({
|
|
610
610
|
...NotificationSchema.entries,
|
|
611
611
|
method: v.literal('notifications/resources/updated'),
|
|
612
|
-
params: v.
|
|
612
|
+
params: v.object({
|
|
613
613
|
...BaseNotificationParamsSchema.entries,
|
|
614
614
|
|
|
615
615
|
/**
|
|
@@ -623,7 +623,7 @@ export const ResourceUpdatedNotificationSchema = v.looseObject({
|
|
|
623
623
|
/**
|
|
624
624
|
* Describes an argument that a prompt can accept.
|
|
625
625
|
*/
|
|
626
|
-
export const PromptArgumentSchema = v.
|
|
626
|
+
export const PromptArgumentSchema = v.object({
|
|
627
627
|
/**
|
|
628
628
|
* The name of the argument.
|
|
629
629
|
*/
|
|
@@ -643,7 +643,7 @@ export const PromptArgumentSchema = v.looseObject({
|
|
|
643
643
|
/**
|
|
644
644
|
* A prompt or prompt template that the server offers.
|
|
645
645
|
*/
|
|
646
|
-
export const PromptSchema = v.
|
|
646
|
+
export const PromptSchema = v.object({
|
|
647
647
|
...BaseMetadataSchema.entries,
|
|
648
648
|
|
|
649
649
|
/**
|
|
@@ -660,13 +660,13 @@ export const PromptSchema = v.looseObject({
|
|
|
660
660
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
661
661
|
* for notes on _meta usage.
|
|
662
662
|
*/
|
|
663
|
-
_meta: v.optional(v.
|
|
663
|
+
_meta: v.optional(v.object({})),
|
|
664
664
|
});
|
|
665
665
|
|
|
666
666
|
/**
|
|
667
667
|
* Sent from the client to request a list of prompts and prompt templates the server has.
|
|
668
668
|
*/
|
|
669
|
-
export const ListPromptsRequestSchema = v.
|
|
669
|
+
export const ListPromptsRequestSchema = v.object({
|
|
670
670
|
...PaginatedRequestSchema.entries,
|
|
671
671
|
method: v.literal('prompts/list'),
|
|
672
672
|
});
|
|
@@ -674,7 +674,7 @@ export const ListPromptsRequestSchema = v.looseObject({
|
|
|
674
674
|
/**
|
|
675
675
|
* The server's response to a prompts/list request from the client.
|
|
676
676
|
*/
|
|
677
|
-
export const ListPromptsResultSchema = v.
|
|
677
|
+
export const ListPromptsResultSchema = v.object({
|
|
678
678
|
...PaginatedResultSchema.entries,
|
|
679
679
|
prompts: v.array(PromptSchema),
|
|
680
680
|
});
|
|
@@ -682,10 +682,10 @@ export const ListPromptsResultSchema = v.looseObject({
|
|
|
682
682
|
/**
|
|
683
683
|
* Used by the client to get a prompt provided by the server.
|
|
684
684
|
*/
|
|
685
|
-
export const GetPromptRequestSchema = v.
|
|
685
|
+
export const GetPromptRequestSchema = v.object({
|
|
686
686
|
...RequestSchema.entries,
|
|
687
687
|
method: v.literal('prompts/get'),
|
|
688
|
-
params: v.
|
|
688
|
+
params: v.object({
|
|
689
689
|
...BaseRequestParamsSchema.entries,
|
|
690
690
|
|
|
691
691
|
/**
|
|
@@ -703,7 +703,7 @@ export const GetPromptRequestSchema = v.looseObject({
|
|
|
703
703
|
/**
|
|
704
704
|
* Text provided to or from an LLM.
|
|
705
705
|
*/
|
|
706
|
-
export const TextContentSchema = v.
|
|
706
|
+
export const TextContentSchema = v.object({
|
|
707
707
|
type: v.literal('text'),
|
|
708
708
|
|
|
709
709
|
/**
|
|
@@ -715,13 +715,13 @@ export const TextContentSchema = v.looseObject({
|
|
|
715
715
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
716
716
|
* for notes on _meta usage.
|
|
717
717
|
*/
|
|
718
|
-
_meta: v.optional(v.
|
|
718
|
+
_meta: v.optional(v.object({})),
|
|
719
719
|
});
|
|
720
720
|
|
|
721
721
|
/**
|
|
722
722
|
* An image provided to or from an LLM.
|
|
723
723
|
*/
|
|
724
|
-
export const ImageContentSchema = v.
|
|
724
|
+
export const ImageContentSchema = v.object({
|
|
725
725
|
type: v.literal('image'),
|
|
726
726
|
|
|
727
727
|
/**
|
|
@@ -738,13 +738,13 @@ export const ImageContentSchema = v.looseObject({
|
|
|
738
738
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
739
739
|
* for notes on _meta usage.
|
|
740
740
|
*/
|
|
741
|
-
_meta: v.optional(v.
|
|
741
|
+
_meta: v.optional(v.object({})),
|
|
742
742
|
});
|
|
743
743
|
|
|
744
744
|
/**
|
|
745
745
|
* An Audio provided to or from an LLM.
|
|
746
746
|
*/
|
|
747
|
-
export const AudioContentSchema = v.
|
|
747
|
+
export const AudioContentSchema = v.object({
|
|
748
748
|
type: v.literal('audio'),
|
|
749
749
|
|
|
750
750
|
/**
|
|
@@ -761,13 +761,13 @@ export const AudioContentSchema = v.looseObject({
|
|
|
761
761
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
762
762
|
* for notes on _meta usage.
|
|
763
763
|
*/
|
|
764
|
-
_meta: v.optional(v.
|
|
764
|
+
_meta: v.optional(v.object({})),
|
|
765
765
|
});
|
|
766
766
|
|
|
767
767
|
/**
|
|
768
768
|
* The contents of a resource, embedded into a prompt or tool call result.
|
|
769
769
|
*/
|
|
770
|
-
export const EmbeddedResourceSchema = v.
|
|
770
|
+
export const EmbeddedResourceSchema = v.object({
|
|
771
771
|
type: v.literal('resource'),
|
|
772
772
|
resource: v.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
773
773
|
|
|
@@ -775,7 +775,7 @@ export const EmbeddedResourceSchema = v.looseObject({
|
|
|
775
775
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
776
776
|
* for notes on _meta usage.
|
|
777
777
|
*/
|
|
778
|
-
_meta: v.optional(v.
|
|
778
|
+
_meta: v.optional(v.object({})),
|
|
779
779
|
});
|
|
780
780
|
|
|
781
781
|
/**
|
|
@@ -783,7 +783,7 @@ export const EmbeddedResourceSchema = v.looseObject({
|
|
|
783
783
|
*
|
|
784
784
|
* Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
|
|
785
785
|
*/
|
|
786
|
-
export const ResourceLinkSchema = v.
|
|
786
|
+
export const ResourceLinkSchema = v.object({
|
|
787
787
|
...ResourceSchema.entries,
|
|
788
788
|
type: v.literal('resource_link'),
|
|
789
789
|
});
|
|
@@ -802,7 +802,7 @@ export const ContentBlockSchema = v.union([
|
|
|
802
802
|
/**
|
|
803
803
|
* Describes a message returned as part of a prompt.
|
|
804
804
|
*/
|
|
805
|
-
export const PromptMessageSchema = v.
|
|
805
|
+
export const PromptMessageSchema = v.object({
|
|
806
806
|
role: v.picklist(['user', 'assistant']),
|
|
807
807
|
content: ContentBlockSchema,
|
|
808
808
|
});
|
|
@@ -810,7 +810,7 @@ export const PromptMessageSchema = v.looseObject({
|
|
|
810
810
|
/**
|
|
811
811
|
* The server's response to a prompts/get request from the client.
|
|
812
812
|
*/
|
|
813
|
-
export const GetPromptResultSchema = v.
|
|
813
|
+
export const GetPromptResultSchema = v.object({
|
|
814
814
|
...ResultSchema.entries,
|
|
815
815
|
|
|
816
816
|
/**
|
|
@@ -823,7 +823,7 @@ export const GetPromptResultSchema = v.looseObject({
|
|
|
823
823
|
/**
|
|
824
824
|
* An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
|
|
825
825
|
*/
|
|
826
|
-
export const PromptListChangedNotificationSchema = v.
|
|
826
|
+
export const PromptListChangedNotificationSchema = v.object({
|
|
827
827
|
...NotificationSchema.entries,
|
|
828
828
|
method: v.literal('notifications/prompts/list_changed'),
|
|
829
829
|
});
|
|
@@ -839,7 +839,7 @@ export const PromptListChangedNotificationSchema = v.looseObject({
|
|
|
839
839
|
* Clients should never make tool use decisions based on ToolAnnotations
|
|
840
840
|
* received from untrusted servers.
|
|
841
841
|
*/
|
|
842
|
-
export const ToolAnnotationsSchema = v.
|
|
842
|
+
export const ToolAnnotationsSchema = v.object({
|
|
843
843
|
/**
|
|
844
844
|
* A human-readable title for the tool.
|
|
845
845
|
*/
|
|
@@ -886,7 +886,7 @@ export const ToolAnnotationsSchema = v.looseObject({
|
|
|
886
886
|
/**
|
|
887
887
|
* Definition for a tool the client can call.
|
|
888
888
|
*/
|
|
889
|
-
export const ToolSchema = v.
|
|
889
|
+
export const ToolSchema = v.object({
|
|
890
890
|
...BaseMetadataSchema.entries,
|
|
891
891
|
|
|
892
892
|
/**
|
|
@@ -897,9 +897,9 @@ export const ToolSchema = v.looseObject({
|
|
|
897
897
|
/**
|
|
898
898
|
* A JSON Schema object defining the expected parameters for the tool.
|
|
899
899
|
*/
|
|
900
|
-
inputSchema: v.
|
|
900
|
+
inputSchema: v.object({
|
|
901
901
|
type: v.literal('object'),
|
|
902
|
-
properties: v.optional(v.
|
|
902
|
+
properties: v.optional(v.object({})),
|
|
903
903
|
required: v.optional(v.array(v.string())),
|
|
904
904
|
}),
|
|
905
905
|
|
|
@@ -908,9 +908,9 @@ export const ToolSchema = v.looseObject({
|
|
|
908
908
|
* the structuredContent field of a CallToolResult.
|
|
909
909
|
*/
|
|
910
910
|
outputSchema: v.optional(
|
|
911
|
-
v.
|
|
911
|
+
v.object({
|
|
912
912
|
type: v.literal('object'),
|
|
913
|
-
properties: v.optional(v.
|
|
913
|
+
properties: v.optional(v.object({})),
|
|
914
914
|
required: v.optional(v.array(v.string())),
|
|
915
915
|
}),
|
|
916
916
|
),
|
|
@@ -924,13 +924,13 @@ export const ToolSchema = v.looseObject({
|
|
|
924
924
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
925
925
|
* for notes on _meta usage.
|
|
926
926
|
*/
|
|
927
|
-
_meta: v.optional(v.
|
|
927
|
+
_meta: v.optional(v.object({})),
|
|
928
928
|
});
|
|
929
929
|
|
|
930
930
|
/**
|
|
931
931
|
* Sent from the client to request a list of tools the server has.
|
|
932
932
|
*/
|
|
933
|
-
export const ListToolsRequestSchema = v.
|
|
933
|
+
export const ListToolsRequestSchema = v.object({
|
|
934
934
|
...PaginatedRequestSchema.entries,
|
|
935
935
|
method: v.literal('tools/list'),
|
|
936
936
|
});
|
|
@@ -938,7 +938,7 @@ export const ListToolsRequestSchema = v.looseObject({
|
|
|
938
938
|
/**
|
|
939
939
|
* The server's response to a tools/list request from the client.
|
|
940
940
|
*/
|
|
941
|
-
export const ListToolsResultSchema = v.
|
|
941
|
+
export const ListToolsResultSchema = v.object({
|
|
942
942
|
...PaginatedResultSchema.entries,
|
|
943
943
|
tools: v.array(ToolSchema),
|
|
944
944
|
});
|
|
@@ -946,7 +946,7 @@ export const ListToolsResultSchema = v.looseObject({
|
|
|
946
946
|
/**
|
|
947
947
|
* The server's response to a tool call.
|
|
948
948
|
*/
|
|
949
|
-
export const CallToolResultSchema = v.
|
|
949
|
+
export const CallToolResultSchema = v.object({
|
|
950
950
|
...ResultSchema.entries,
|
|
951
951
|
|
|
952
952
|
/**
|
|
@@ -986,16 +986,16 @@ export const CallToolResultSchema = v.looseObject({
|
|
|
986
986
|
*/
|
|
987
987
|
export const CompatibilityCallToolResultSchema = v.union([
|
|
988
988
|
CallToolResultSchema,
|
|
989
|
-
v.
|
|
989
|
+
v.object({ ...ResultSchema.entries, toolResult: v.unknown() }),
|
|
990
990
|
]);
|
|
991
991
|
|
|
992
992
|
/**
|
|
993
993
|
* Used by the client to invoke a tool provided by the server.
|
|
994
994
|
*/
|
|
995
|
-
export const CallToolRequestSchema = v.
|
|
995
|
+
export const CallToolRequestSchema = v.object({
|
|
996
996
|
...RequestSchema.entries,
|
|
997
997
|
method: v.literal('tools/call'),
|
|
998
|
-
params: v.
|
|
998
|
+
params: v.object({
|
|
999
999
|
...BaseRequestParamsSchema.entries,
|
|
1000
1000
|
name: v.string(),
|
|
1001
1001
|
arguments: v.optional(v.record(v.string(), v.unknown())),
|
|
@@ -1005,7 +1005,7 @@ export const CallToolRequestSchema = v.looseObject({
|
|
|
1005
1005
|
/**
|
|
1006
1006
|
* An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
|
|
1007
1007
|
*/
|
|
1008
|
-
export const ToolListChangedNotificationSchema = v.
|
|
1008
|
+
export const ToolListChangedNotificationSchema = v.object({
|
|
1009
1009
|
...NotificationSchema.entries,
|
|
1010
1010
|
method: v.literal('notifications/tools/list_changed'),
|
|
1011
1011
|
});
|
|
@@ -1028,10 +1028,10 @@ export const LoggingLevelSchema = v.picklist([
|
|
|
1028
1028
|
/**
|
|
1029
1029
|
* A request from the client to the server, to enable or adjust logging.
|
|
1030
1030
|
*/
|
|
1031
|
-
export const SetLevelRequestSchema = v.
|
|
1031
|
+
export const SetLevelRequestSchema = v.object({
|
|
1032
1032
|
...RequestSchema.entries,
|
|
1033
1033
|
method: v.literal('logging/setLevel'),
|
|
1034
|
-
params: v.
|
|
1034
|
+
params: v.object({
|
|
1035
1035
|
...BaseRequestParamsSchema.entries,
|
|
1036
1036
|
|
|
1037
1037
|
/**
|
|
@@ -1044,10 +1044,10 @@ export const SetLevelRequestSchema = v.looseObject({
|
|
|
1044
1044
|
/**
|
|
1045
1045
|
* Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
|
|
1046
1046
|
*/
|
|
1047
|
-
export const LoggingMessageNotificationSchema = v.
|
|
1047
|
+
export const LoggingMessageNotificationSchema = v.object({
|
|
1048
1048
|
...NotificationSchema.entries,
|
|
1049
1049
|
method: v.literal('notifications/message'),
|
|
1050
|
-
params: v.
|
|
1050
|
+
params: v.object({
|
|
1051
1051
|
...BaseNotificationParamsSchema.entries,
|
|
1052
1052
|
|
|
1053
1053
|
/**
|
|
@@ -1071,7 +1071,7 @@ export const LoggingMessageNotificationSchema = v.looseObject({
|
|
|
1071
1071
|
/**
|
|
1072
1072
|
* Hints to use for model selection.
|
|
1073
1073
|
*/
|
|
1074
|
-
export const ModelHintSchema = v.
|
|
1074
|
+
export const ModelHintSchema = v.object({
|
|
1075
1075
|
/**
|
|
1076
1076
|
* A hint for a model name.
|
|
1077
1077
|
*/
|
|
@@ -1081,7 +1081,7 @@ export const ModelHintSchema = v.looseObject({
|
|
|
1081
1081
|
/**
|
|
1082
1082
|
* The server's preferences for model selection, requested of the client during sampling.
|
|
1083
1083
|
*/
|
|
1084
|
-
export const ModelPreferencesSchema = v.
|
|
1084
|
+
export const ModelPreferencesSchema = v.object({
|
|
1085
1085
|
/**
|
|
1086
1086
|
* Optional hints to use for model selection.
|
|
1087
1087
|
*/
|
|
@@ -1108,7 +1108,7 @@ export const ModelPreferencesSchema = v.looseObject({
|
|
|
1108
1108
|
/**
|
|
1109
1109
|
* Describes a message issued to or received from an LLM API.
|
|
1110
1110
|
*/
|
|
1111
|
-
export const SamplingMessageSchema = v.
|
|
1111
|
+
export const SamplingMessageSchema = v.object({
|
|
1112
1112
|
role: v.picklist(['user', 'assistant']),
|
|
1113
1113
|
content: v.union([
|
|
1114
1114
|
TextContentSchema,
|
|
@@ -1117,7 +1117,7 @@ export const SamplingMessageSchema = v.looseObject({
|
|
|
1117
1117
|
]),
|
|
1118
1118
|
});
|
|
1119
1119
|
|
|
1120
|
-
export const CreateMessageRequestParamsSchema = v.
|
|
1120
|
+
export const CreateMessageRequestParamsSchema = v.object({
|
|
1121
1121
|
...BaseRequestParamsSchema.entries,
|
|
1122
1122
|
messages: v.array(SamplingMessageSchema),
|
|
1123
1123
|
|
|
@@ -1143,7 +1143,7 @@ export const CreateMessageRequestParamsSchema = v.looseObject({
|
|
|
1143
1143
|
/**
|
|
1144
1144
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
1145
1145
|
*/
|
|
1146
|
-
metadata: v.optional(v.
|
|
1146
|
+
metadata: v.optional(v.object({})),
|
|
1147
1147
|
|
|
1148
1148
|
/**
|
|
1149
1149
|
* The server's preferences for which model to select.
|
|
@@ -1154,7 +1154,7 @@ export const CreateMessageRequestParamsSchema = v.looseObject({
|
|
|
1154
1154
|
/**
|
|
1155
1155
|
* A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
|
|
1156
1156
|
*/
|
|
1157
|
-
export const CreateMessageRequestSchema = v.
|
|
1157
|
+
export const CreateMessageRequestSchema = v.object({
|
|
1158
1158
|
...RequestSchema.entries,
|
|
1159
1159
|
method: v.literal('sampling/createMessage'),
|
|
1160
1160
|
params: CreateMessageRequestParamsSchema,
|
|
@@ -1163,7 +1163,7 @@ export const CreateMessageRequestSchema = v.looseObject({
|
|
|
1163
1163
|
/**
|
|
1164
1164
|
* The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
|
|
1165
1165
|
*/
|
|
1166
|
-
export const CreateMessageResultSchema = v.
|
|
1166
|
+
export const CreateMessageResultSchema = v.object({
|
|
1167
1167
|
...ResultSchema.entries,
|
|
1168
1168
|
|
|
1169
1169
|
/**
|
|
@@ -1192,7 +1192,7 @@ export const CreateMessageResultSchema = v.looseObject({
|
|
|
1192
1192
|
/**
|
|
1193
1193
|
* Primitive schema definition for boolean fields.
|
|
1194
1194
|
*/
|
|
1195
|
-
export const BooleanSchemaSchema = v.
|
|
1195
|
+
export const BooleanSchemaSchema = v.object({
|
|
1196
1196
|
type: v.literal('boolean'),
|
|
1197
1197
|
title: v.optional(v.string()),
|
|
1198
1198
|
description: v.optional(v.string()),
|
|
@@ -1202,7 +1202,7 @@ export const BooleanSchemaSchema = v.looseObject({
|
|
|
1202
1202
|
/**
|
|
1203
1203
|
* Primitive schema definition for string fields.
|
|
1204
1204
|
*/
|
|
1205
|
-
export const StringSchemaSchema = v.
|
|
1205
|
+
export const StringSchemaSchema = v.object({
|
|
1206
1206
|
type: v.literal('string'),
|
|
1207
1207
|
title: v.optional(v.string()),
|
|
1208
1208
|
description: v.optional(v.string()),
|
|
@@ -1214,7 +1214,7 @@ export const StringSchemaSchema = v.looseObject({
|
|
|
1214
1214
|
/**
|
|
1215
1215
|
* Primitive schema definition for number fields.
|
|
1216
1216
|
*/
|
|
1217
|
-
export const NumberSchemaSchema = v.
|
|
1217
|
+
export const NumberSchemaSchema = v.object({
|
|
1218
1218
|
type: v.picklist(['number', 'integer']),
|
|
1219
1219
|
title: v.optional(v.string()),
|
|
1220
1220
|
description: v.optional(v.string()),
|
|
@@ -1225,7 +1225,7 @@ export const NumberSchemaSchema = v.looseObject({
|
|
|
1225
1225
|
/**
|
|
1226
1226
|
* Primitive schema definition for enum fields.
|
|
1227
1227
|
*/
|
|
1228
|
-
export const EnumSchemaSchema = v.
|
|
1228
|
+
export const EnumSchemaSchema = v.object({
|
|
1229
1229
|
type: v.literal('string'),
|
|
1230
1230
|
title: v.optional(v.string()),
|
|
1231
1231
|
description: v.optional(v.string()),
|
|
@@ -1247,10 +1247,10 @@ export const PrimitiveSchemaDefinitionSchema = v.union([
|
|
|
1247
1247
|
* A request from the server to elicit user input via the client.
|
|
1248
1248
|
* The client should present the message and form fields to the user.
|
|
1249
1249
|
*/
|
|
1250
|
-
export const ElicitRequestSchema = v.
|
|
1250
|
+
export const ElicitRequestSchema = v.object({
|
|
1251
1251
|
...RequestSchema.entries,
|
|
1252
1252
|
method: v.literal('elicitation/create'),
|
|
1253
|
-
params: v.
|
|
1253
|
+
params: v.object({
|
|
1254
1254
|
...BaseRequestParamsSchema.entries,
|
|
1255
1255
|
|
|
1256
1256
|
/**
|
|
@@ -1261,7 +1261,7 @@ export const ElicitRequestSchema = v.looseObject({
|
|
|
1261
1261
|
/**
|
|
1262
1262
|
* The schema for the requested user input.
|
|
1263
1263
|
*/
|
|
1264
|
-
requestedSchema: v.
|
|
1264
|
+
requestedSchema: v.object({
|
|
1265
1265
|
type: v.literal('object'),
|
|
1266
1266
|
properties: v.record(v.string(), PrimitiveSchemaDefinitionSchema),
|
|
1267
1267
|
required: v.optional(v.array(v.string())),
|
|
@@ -1272,7 +1272,7 @@ export const ElicitRequestSchema = v.looseObject({
|
|
|
1272
1272
|
/**
|
|
1273
1273
|
* The client's response to an elicitation/create request from the server.
|
|
1274
1274
|
*/
|
|
1275
|
-
export const ElicitResultSchema = v.
|
|
1275
|
+
export const ElicitResultSchema = v.object({
|
|
1276
1276
|
...ResultSchema.entries,
|
|
1277
1277
|
|
|
1278
1278
|
/**
|
|
@@ -1290,7 +1290,7 @@ export const ElicitResultSchema = v.looseObject({
|
|
|
1290
1290
|
/**
|
|
1291
1291
|
* A reference to a resource or resource template definition.
|
|
1292
1292
|
*/
|
|
1293
|
-
export const ResourceTemplateReferenceSchema = v.
|
|
1293
|
+
export const ResourceTemplateReferenceSchema = v.object({
|
|
1294
1294
|
type: v.literal('ref/resource'),
|
|
1295
1295
|
|
|
1296
1296
|
/**
|
|
@@ -1307,7 +1307,7 @@ export const ResourceReferenceSchema = ResourceTemplateReferenceSchema;
|
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Identifies a prompt.
|
|
1309
1309
|
*/
|
|
1310
|
-
export const PromptReferenceSchema = v.
|
|
1310
|
+
export const PromptReferenceSchema = v.object({
|
|
1311
1311
|
type: v.literal('ref/prompt'),
|
|
1312
1312
|
|
|
1313
1313
|
/**
|
|
@@ -1319,17 +1319,17 @@ export const PromptReferenceSchema = v.looseObject({
|
|
|
1319
1319
|
/**
|
|
1320
1320
|
* A request from the client to the server, to ask for completion options.
|
|
1321
1321
|
*/
|
|
1322
|
-
export const CompleteRequestSchema = v.
|
|
1322
|
+
export const CompleteRequestSchema = v.object({
|
|
1323
1323
|
...RequestSchema.entries,
|
|
1324
1324
|
method: v.literal('completion/complete'),
|
|
1325
|
-
params: v.
|
|
1325
|
+
params: v.object({
|
|
1326
1326
|
...BaseRequestParamsSchema.entries,
|
|
1327
1327
|
ref: v.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
1328
1328
|
|
|
1329
1329
|
/**
|
|
1330
1330
|
* The argument's information
|
|
1331
1331
|
*/
|
|
1332
|
-
argument: v.
|
|
1332
|
+
argument: v.object({
|
|
1333
1333
|
/**
|
|
1334
1334
|
* The name of the argument
|
|
1335
1335
|
*/
|
|
@@ -1354,9 +1354,9 @@ export const CompleteRequestSchema = v.looseObject({
|
|
|
1354
1354
|
/**
|
|
1355
1355
|
* The server's response to a completion/complete request
|
|
1356
1356
|
*/
|
|
1357
|
-
export const CompleteResultSchema = v.
|
|
1357
|
+
export const CompleteResultSchema = v.object({
|
|
1358
1358
|
...ResultSchema.entries,
|
|
1359
|
-
completion: v.
|
|
1359
|
+
completion: v.object({
|
|
1360
1360
|
/**
|
|
1361
1361
|
* An array of completion values. Must not exceed 100 items.
|
|
1362
1362
|
*/
|
|
@@ -1378,7 +1378,7 @@ export const CompleteResultSchema = v.looseObject({
|
|
|
1378
1378
|
/**
|
|
1379
1379
|
* Represents a root directory or file that the server can operate on.
|
|
1380
1380
|
*/
|
|
1381
|
-
export const RootSchema = v.
|
|
1381
|
+
export const RootSchema = v.object({
|
|
1382
1382
|
/**
|
|
1383
1383
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
1384
1384
|
*/
|
|
@@ -1393,13 +1393,13 @@ export const RootSchema = v.looseObject({
|
|
|
1393
1393
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
1394
1394
|
* for notes on _meta usage.
|
|
1395
1395
|
*/
|
|
1396
|
-
_meta: v.optional(v.
|
|
1396
|
+
_meta: v.optional(v.object({})),
|
|
1397
1397
|
});
|
|
1398
1398
|
|
|
1399
1399
|
/**
|
|
1400
1400
|
* Sent from the server to request a list of root URIs from the client.
|
|
1401
1401
|
*/
|
|
1402
|
-
export const ListRootsRequestSchema = v.
|
|
1402
|
+
export const ListRootsRequestSchema = v.object({
|
|
1403
1403
|
...RequestSchema.entries,
|
|
1404
1404
|
method: v.literal('roots/list'),
|
|
1405
1405
|
});
|
|
@@ -1407,7 +1407,7 @@ export const ListRootsRequestSchema = v.looseObject({
|
|
|
1407
1407
|
/**
|
|
1408
1408
|
* The client's response to a roots/list request from the server.
|
|
1409
1409
|
*/
|
|
1410
|
-
export const ListRootsResultSchema = v.
|
|
1410
|
+
export const ListRootsResultSchema = v.object({
|
|
1411
1411
|
...ResultSchema.entries,
|
|
1412
1412
|
roots: v.array(RootSchema),
|
|
1413
1413
|
});
|
|
@@ -1415,7 +1415,7 @@ export const ListRootsResultSchema = v.looseObject({
|
|
|
1415
1415
|
/**
|
|
1416
1416
|
* A notification from the client to the server, informing it that the list of roots has changed.
|
|
1417
1417
|
*/
|
|
1418
|
-
export const RootsListChangedNotificationSchema = v.
|
|
1418
|
+
export const RootsListChangedNotificationSchema = v.object({
|
|
1419
1419
|
...NotificationSchema.entries,
|
|
1420
1420
|
method: v.literal('notifications/roots/list_changed'),
|
|
1421
1421
|
});
|