@@ -250,12 +250,8 @@ export interface ProgressNotification extends Notification {
250
250
} ;
251
251
}
252
252
253
- /* Resources */
254
- /**
255
- * Sent from the client to request a list of resources the server has.
256
- */
257
- export interface ListResourcesRequest extends Request {
258
- method : "resources/list" ;
253
+ /* Pagination */
254
+ export interface PaginatedRequest extends Request {
259
255
params ?: {
260
256
/**
261
257
* An opaque token representing the current pagination position.
@@ -265,44 +261,41 @@ export interface ListResourcesRequest extends Request {
265
261
} ;
266
262
}
267
263
268
- /**
269
- * The server's response to a resources/list request from the client.
270
- */
271
- export interface ListResourcesResult extends Result {
272
- resources : Resource [ ] ;
273
-
264
+ export interface PaginatedResult extends Result {
274
265
/**
275
266
* An opaque token representing the pagination position after the last returned result.
276
267
* If present, there may be more results available.
277
268
*/
278
269
nextCursor ?: Cursor ;
279
270
}
280
271
272
+ /* Resources */
273
+ /**
274
+ * Sent from the client to request a list of resources the server has.
275
+ */
276
+ export interface ListResourcesRequest extends PaginatedRequest {
277
+ method : "resources/list" ;
278
+ }
279
+
280
+ /**
281
+ * The server's response to a resources/list request from the client.
282
+ */
283
+ export interface ListResourcesResult extends PaginatedResult {
284
+ resources : Resource [ ] ;
285
+ }
286
+
281
287
/**
282
288
* Sent from the client to request a list of resource templates the server has.
283
289
*/
284
- export interface ListResourceTemplatesRequest extends Request {
290
+ export interface ListResourceTemplatesRequest extends PaginatedRequest {
285
291
method : "resources/templates/list" ;
286
- params ?: {
287
- /**
288
- * An opaque token representing the current pagination position.
289
- * If provided, the server should return results starting after this cursor.
290
- */
291
- cursor ?: Cursor ;
292
- } ;
293
292
}
294
293
295
294
/**
296
295
* The server's response to a resources/templates/list request from the client.
297
296
*/
298
- export interface ListResourceTemplatesResult extends Result {
297
+ export interface ListResourceTemplatesResult extends PaginatedResult {
299
298
resourceTemplates : ResourceTemplate [ ] ;
300
-
301
- /**
302
- * An opaque token representing the pagination position after the last returned result.
303
- * If present, there may be more results available.
304
- */
305
- nextCursor ?: Cursor ;
306
299
}
307
300
308
301
/**
@@ -477,28 +470,15 @@ export interface BlobResourceContents extends ResourceContents {
477
470
/**
478
471
* Sent from the client to request a list of prompts and prompt templates the server has.
479
472
*/
480
- export interface ListPromptsRequest extends Request {
473
+ export interface ListPromptsRequest extends PaginatedRequest {
481
474
method : "prompts/list" ;
482
- params ?: {
483
- /**
484
- * An opaque token representing the current pagination position.
485
- * If provided, the server should return results starting after this cursor.
486
- */
487
- cursor ?: Cursor ;
488
- } ;
489
475
}
490
476
491
477
/**
492
478
* The server's response to a prompts/list request from the client.
493
479
*/
494
- export interface ListPromptsResult extends Result {
480
+ export interface ListPromptsResult extends PaginatedResult {
495
481
prompts : Prompt [ ] ;
496
-
497
- /**
498
- * An opaque token representing the pagination position after the last returned result.
499
- * If present, there may be more results available.
500
- */
501
- nextCursor ?: Cursor ;
502
482
}
503
483
504
484
/**
@@ -576,28 +556,15 @@ export interface PromptListChangedNotification extends Notification {
576
556
/**
577
557
* Sent from the client to request a list of tools the server has.
578
558
*/
579
- export interface ListToolsRequest extends Request {
559
+ export interface ListToolsRequest extends PaginatedRequest {
580
560
method : "tools/list" ;
581
- params ?: {
582
- /**
583
- * An opaque token representing the current pagination position.
584
- * If provided, the server should return results starting after this cursor.
585
- */
586
- cursor ?: Cursor ;
587
- } ;
588
561
}
589
562
590
563
/**
591
564
* The server's response to a tools/list request from the client.
592
565
*/
593
- export interface ListToolsResult extends Result {
566
+ export interface ListToolsResult extends PaginatedResult {
594
567
tools : Tool [ ] ;
595
-
596
- /**
597
- * An opaque token representing the pagination position after the last returned result.
598
- * If present, there may be more results available.
599
- */
600
- nextCursor ?: Cursor ;
601
568
}
602
569
603
570
/**
0 commit comments