@@ -18,6 +18,11 @@ import {
18
18
ListToolsRequestSchema ,
19
19
ListPromptsRequestSchema ,
20
20
SetLevelRequestSchema ,
21
+ CreateMessageRequest ,
22
+ CreateMessageResultSchema ,
23
+ EmptyResultSchema ,
24
+ LoggingMessageNotification ,
25
+ ResourceUpdatedNotification ,
21
26
} from "../types.js" ;
22
27
23
28
/**
@@ -133,4 +138,40 @@ export class Server<
133
138
: undefined ,
134
139
} ;
135
140
}
141
+
142
+ async ping ( ) {
143
+ return this . request ( { method : "ping" } , EmptyResultSchema ) ;
144
+ }
145
+
146
+ async createMessage ( params : CreateMessageRequest [ "params" ] ) {
147
+ return this . request (
148
+ { method : "sampling/createMessage" , params } ,
149
+ CreateMessageResultSchema ,
150
+ ) ;
151
+ }
152
+
153
+ async sendLoggingMessage ( params : LoggingMessageNotification [ "params" ] ) {
154
+ return this . notification ( { method : "notifications/message" , params } ) ;
155
+ }
156
+
157
+ async sendResourceUpdated ( params : ResourceUpdatedNotification [ "params" ] ) {
158
+ return this . notification ( {
159
+ method : "notifications/resources/updated" ,
160
+ params,
161
+ } ) ;
162
+ }
163
+
164
+ async sendResourceListChanged ( ) {
165
+ return this . notification ( {
166
+ method : "notifications/resources/list_changed" ,
167
+ } ) ;
168
+ }
169
+
170
+ async sendToolListChanged ( ) {
171
+ return this . notification ( { method : "notifications/tools/list_changed" } ) ;
172
+ }
173
+
174
+ async sendPromptListChanged ( ) {
175
+ return this . notification ( { method : "notifications/prompts/list_changed" } ) ;
176
+ }
136
177
}
0 commit comments