diff --git a/src/client/index.ts b/src/client/index.ts index a18b45d0..5649866a 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -29,6 +29,8 @@ import { ListToolsResultSchema, EmptyResultSchema, LoggingLevel, + ListResourceTemplatesRequest, + ListResourceTemplatesResultSchema, } from "../types.js"; /** @@ -177,6 +179,17 @@ export class Client< ); } + async listResourceTemplates( + params?: ListResourceTemplatesRequest["params"], + onprogress?: ProgressCallback, + ) { + return this.request( + { method: "resources/templates/list", params }, + ListResourceTemplatesResultSchema, + onprogress, + ); + } + async readResource( params: ReadResourceRequest["params"], onprogress?: ProgressCallback, @@ -223,4 +236,8 @@ export class Client< onprogress, ); } + + async sendRootsListChanged() { + return this.notification({ method: "notifications/roots/list_changed" }); + } } diff --git a/src/server/index.ts b/src/server/index.ts index c6350fff..dc546625 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -23,6 +23,8 @@ import { EmptyResultSchema, LoggingMessageNotification, ResourceUpdatedNotification, + ListRootsRequest, + ListRootsResultSchema, } from "../types.js"; /** @@ -154,6 +156,17 @@ export class Server< ); } + async listRoots( + params?: ListRootsRequest["params"], + onprogress?: ProgressCallback, + ) { + return this.request( + { method: "roots/list", params }, + ListRootsResultSchema, + onprogress, + ); + } + async sendLoggingMessage(params: LoggingMessageNotification["params"]) { return this.notification({ method: "notifications/message", params }); }