Skip to content

Commit d3f05f6

Browse files
Merge pull request #37 from modelcontextprotocol/justin/spec-updates
Update to spec version 2024-11-05
2 parents 9b8bf3b + f74a289 commit d3f05f6

File tree

3 files changed

+214
-45
lines changed

3 files changed

+214
-45
lines changed

Diff for: src/client/index.ts

+17
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import {
2929
ListToolsResultSchema,
3030
EmptyResultSchema,
3131
LoggingLevel,
32+
ListResourceTemplatesRequest,
33+
ListResourceTemplatesResultSchema,
3234
} from "../types.js";
3335

3436
/**
@@ -177,6 +179,17 @@ export class Client<
177179
);
178180
}
179181

182+
async listResourceTemplates(
183+
params?: ListResourceTemplatesRequest["params"],
184+
onprogress?: ProgressCallback,
185+
) {
186+
return this.request(
187+
{ method: "resources/templates/list", params },
188+
ListResourceTemplatesResultSchema,
189+
onprogress,
190+
);
191+
}
192+
180193
async readResource(
181194
params: ReadResourceRequest["params"],
182195
onprogress?: ProgressCallback,
@@ -223,4 +236,8 @@ export class Client<
223236
onprogress,
224237
);
225238
}
239+
240+
async sendRootsListChanged() {
241+
return this.notification({ method: "notifications/roots/list_changed" });
242+
}
226243
}

Diff for: src/server/index.ts

+13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import {
2323
EmptyResultSchema,
2424
LoggingMessageNotification,
2525
ResourceUpdatedNotification,
26+
ListRootsRequest,
27+
ListRootsResultSchema,
2628
} from "../types.js";
2729

2830
/**
@@ -154,6 +156,17 @@ export class Server<
154156
);
155157
}
156158

159+
async listRoots(
160+
params?: ListRootsRequest["params"],
161+
onprogress?: ProgressCallback,
162+
) {
163+
return this.request(
164+
{ method: "roots/list", params },
165+
ListRootsResultSchema,
166+
onprogress,
167+
);
168+
}
169+
157170
async sendLoggingMessage(params: LoggingMessageNotification["params"]) {
158171
return this.notification({ method: "notifications/message", params });
159172
}

0 commit comments

Comments
 (0)