From d474c570e4f346b8fa7f2f42dbcee6b9496f95fa Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Mon, 4 Nov 2024 20:45:52 +0000 Subject: [PATCH] Add basic exercise of `params` typing --- src/cli.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 8031fcb7..f7bc15af 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -9,11 +9,12 @@ import WebSocket from "ws"; import express from "express"; import { Client } from "./client/index.js"; import { SSEClientTransport } from "./client/sse.js"; +import { StdioClientTransport } from "./client/stdio.js"; +import { WebSocketClientTransport } from "./client/websocket.js"; import { Server } from "./server/index.js"; import { SSEServerTransport } from "./server/sse.js"; -import { WebSocketClientTransport } from "./client/websocket.js"; -import { StdioClientTransport } from "./client/stdio.js"; import { StdioServerTransport } from "./server/stdio.js"; +import { ListResourcesResultSchema } from "./types.js"; async function runClient(url_or_command: string, args: string[]) { const client = new Client({ @@ -46,6 +47,8 @@ async function runClient(url_or_command: string, args: string[]) { await client.connect(clientTransport); console.log("Initialized."); + await client.request({ method: "resources/list", params: {} }, ListResourcesResultSchema); + await client.close(); console.log("Closed."); }