Skip to content

Commit 8be664b

Browse files
committed
Merge branch 'main' into justin/custom-requests
2 parents f5fa3cf + bfb6ffc commit 8be664b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/cli.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import WebSocket from "ws";
99
import express from "express";
1010
import { Client } from "./client/index.js";
1111
import { SSEClientTransport } from "./client/sse.js";
12+
import { StdioClientTransport } from "./client/stdio.js";
13+
import { WebSocketClientTransport } from "./client/websocket.js";
1214
import { Server } from "./server/index.js";
1315
import { SSEServerTransport } from "./server/sse.js";
14-
import { WebSocketClientTransport } from "./client/websocket.js";
15-
import { StdioClientTransport } from "./client/stdio.js";
1616
import { StdioServerTransport } from "./server/stdio.js";
17+
import { ListResourcesResultSchema } from "./types.js";
1718

1819
async function runClient(url_or_command: string, args: string[]) {
1920
const client = new Client({
@@ -46,6 +47,8 @@ async function runClient(url_or_command: string, args: string[]) {
4647
await client.connect(clientTransport);
4748
console.log("Initialized.");
4849

50+
await client.request({ method: "resources/list" }, ListResourcesResultSchema);
51+
4952
await client.close();
5053
console.log("Closed.");
5154
}

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export const ProgressNotificationSchema = NotificationSchema.extend({
338338
/**
339339
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
340340
*/
341-
progressToken: z.optional(ProgressTokenSchema),
341+
progressToken: ProgressTokenSchema,
342342
}),
343343
});
344344

@@ -350,7 +350,7 @@ export const PaginatedRequestSchema = RequestSchema.extend({
350350
* If provided, the server should return results starting after this cursor.
351351
*/
352352
cursor: z.optional(CursorSchema),
353-
}),
353+
}).optional(),
354354
});
355355

356356
export const PaginatedResultSchema = ResultSchema.extend({

0 commit comments

Comments
 (0)