@kadi.build/core 0.0.1-alpha.1 → 0.0.1-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/README.md +361 -230
  2. package/dist/abilities/AbilityCache.d.ts +242 -0
  3. package/dist/abilities/AbilityCache.d.ts.map +1 -0
  4. package/dist/abilities/AbilityCache.js +285 -0
  5. package/dist/abilities/AbilityCache.js.map +1 -0
  6. package/dist/abilities/AbilityContext.d.ts +215 -0
  7. package/dist/abilities/AbilityContext.d.ts.map +1 -0
  8. package/dist/abilities/AbilityContext.js +36 -0
  9. package/dist/abilities/AbilityContext.js.map +1 -0
  10. package/dist/abilities/AbilityLoader.d.ts +203 -0
  11. package/dist/abilities/AbilityLoader.d.ts.map +1 -0
  12. package/dist/abilities/AbilityLoader.js +343 -0
  13. package/dist/abilities/AbilityLoader.js.map +1 -0
  14. package/dist/abilities/AbilityProxy.d.ts +496 -0
  15. package/dist/abilities/AbilityProxy.d.ts.map +1 -0
  16. package/dist/abilities/AbilityProxy.js +551 -0
  17. package/dist/abilities/AbilityProxy.js.map +1 -0
  18. package/dist/abilities/AbilityValidator.d.ts +172 -0
  19. package/dist/abilities/AbilityValidator.d.ts.map +1 -0
  20. package/dist/abilities/AbilityValidator.js +253 -0
  21. package/dist/abilities/AbilityValidator.js.map +1 -0
  22. package/dist/abilities/index.d.ts +26 -0
  23. package/dist/abilities/index.d.ts.map +1 -0
  24. package/dist/abilities/index.js +23 -0
  25. package/dist/abilities/index.js.map +1 -0
  26. package/dist/abilities/types.d.ts +223 -0
  27. package/dist/abilities/types.d.ts.map +1 -0
  28. package/dist/abilities/types.js +10 -0
  29. package/dist/abilities/types.js.map +1 -0
  30. package/dist/api/index.d.ts +92 -0
  31. package/dist/api/index.d.ts.map +1 -0
  32. package/dist/api/index.js +124 -0
  33. package/dist/api/index.js.map +1 -0
  34. package/dist/broker/BrokerConnection.d.ts +253 -0
  35. package/dist/broker/BrokerConnection.d.ts.map +1 -0
  36. package/dist/broker/BrokerConnection.js +434 -0
  37. package/dist/broker/BrokerConnection.js.map +1 -0
  38. package/dist/broker/BrokerConnectionManager.d.ts +216 -0
  39. package/dist/broker/BrokerConnectionManager.d.ts.map +1 -0
  40. package/dist/broker/BrokerConnectionManager.js +305 -0
  41. package/dist/broker/BrokerConnectionManager.js.map +1 -0
  42. package/dist/broker/BrokerProtocol.d.ts +280 -0
  43. package/dist/broker/BrokerProtocol.d.ts.map +1 -0
  44. package/dist/broker/BrokerProtocol.js +466 -0
  45. package/dist/broker/BrokerProtocol.js.map +1 -0
  46. package/dist/broker/index.d.ts +9 -0
  47. package/dist/broker/index.d.ts.map +1 -0
  48. package/dist/broker/index.js +9 -0
  49. package/dist/broker/index.js.map +1 -0
  50. package/dist/client/KadiClient.d.ts +459 -0
  51. package/dist/client/KadiClient.d.ts.map +1 -0
  52. package/dist/client/KadiClient.js +902 -0
  53. package/dist/client/KadiClient.js.map +1 -0
  54. package/dist/client/index.d.ts +7 -0
  55. package/dist/client/index.d.ts.map +1 -0
  56. package/dist/client/index.js +7 -0
  57. package/dist/client/index.js.map +1 -0
  58. package/dist/config/ConfigLoader.d.ts +138 -0
  59. package/dist/config/ConfigLoader.d.ts.map +1 -0
  60. package/dist/config/ConfigLoader.js +226 -0
  61. package/dist/config/ConfigLoader.js.map +1 -0
  62. package/dist/config/ConfigResolver.d.ts +135 -0
  63. package/dist/config/ConfigResolver.d.ts.map +1 -0
  64. package/dist/config/ConfigResolver.js +282 -0
  65. package/dist/config/ConfigResolver.js.map +1 -0
  66. package/dist/config/index.d.ts +8 -0
  67. package/dist/config/index.d.ts.map +1 -0
  68. package/dist/config/index.js +8 -0
  69. package/dist/config/index.js.map +1 -0
  70. package/dist/errors/index.d.ts +9 -0
  71. package/dist/errors/index.d.ts.map +1 -0
  72. package/dist/errors/index.js +8 -0
  73. package/dist/errors/index.js.map +1 -0
  74. package/dist/events/EventHub.d.ts +172 -0
  75. package/dist/events/EventHub.d.ts.map +1 -0
  76. package/dist/events/EventHub.js +333 -0
  77. package/dist/events/EventHub.js.map +1 -0
  78. package/dist/events/index.d.ts +7 -0
  79. package/dist/events/index.d.ts.map +1 -0
  80. package/dist/events/index.js +7 -0
  81. package/dist/events/index.js.map +1 -0
  82. package/dist/index.d.ts +50 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/index.js +67 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/messages/index.d.ts +33 -0
  87. package/dist/messages/index.d.ts.map +1 -0
  88. package/dist/messages/index.js +33 -0
  89. package/dist/messages/index.js.map +1 -0
  90. package/dist/schemas/index.d.ts +22 -0
  91. package/dist/schemas/index.d.ts.map +1 -0
  92. package/dist/schemas/index.js +27 -0
  93. package/dist/schemas/index.js.map +1 -0
  94. package/dist/schemas/kadi-extensions.d.ts +231 -0
  95. package/dist/schemas/kadi-extensions.d.ts.map +1 -0
  96. package/dist/schemas/kadi-extensions.js +14 -0
  97. package/dist/schemas/kadi-extensions.js.map +1 -0
  98. package/dist/schemas/mcp/schema.d.ts +1399 -0
  99. package/dist/schemas/mcp/schema.d.ts.map +1 -0
  100. package/dist/schemas/mcp/schema.js +53 -0
  101. package/dist/schemas/mcp/schema.js.map +1 -0
  102. package/dist/schemas/mcp/version.d.ts +37 -0
  103. package/dist/schemas/mcp/version.d.ts.map +1 -0
  104. package/dist/schemas/mcp/version.js +39 -0
  105. package/dist/schemas/mcp/version.js.map +1 -0
  106. package/dist/schemas/schema-builders.d.ts +178 -0
  107. package/dist/schemas/schema-builders.d.ts.map +1 -0
  108. package/dist/schemas/schema-builders.js +258 -0
  109. package/dist/schemas/schema-builders.js.map +1 -0
  110. package/dist/schemas/zod-helpers.d.ts +129 -0
  111. package/dist/schemas/zod-helpers.d.ts.map +1 -0
  112. package/dist/schemas/zod-helpers.js +225 -0
  113. package/dist/schemas/zod-helpers.js.map +1 -0
  114. package/dist/schemas/zod-to-json-schema.d.ts +159 -0
  115. package/dist/schemas/zod-to-json-schema.d.ts.map +1 -0
  116. package/dist/schemas/zod-to-json-schema.js +154 -0
  117. package/dist/schemas/zod-to-json-schema.js.map +1 -0
  118. package/dist/tools/ToolRegistry.d.ts +256 -0
  119. package/dist/tools/ToolRegistry.d.ts.map +1 -0
  120. package/dist/tools/ToolRegistry.js +340 -0
  121. package/dist/tools/ToolRegistry.js.map +1 -0
  122. package/dist/tools/index.d.ts +7 -0
  123. package/dist/tools/index.d.ts.map +1 -0
  124. package/dist/tools/index.js +7 -0
  125. package/dist/tools/index.js.map +1 -0
  126. package/dist/transports/BrokerTransport.d.ts +151 -0
  127. package/dist/transports/BrokerTransport.d.ts.map +1 -0
  128. package/dist/transports/BrokerTransport.js +261 -0
  129. package/dist/transports/BrokerTransport.js.map +1 -0
  130. package/dist/transports/NativeTransport.d.ts +178 -0
  131. package/dist/transports/NativeTransport.d.ts.map +1 -0
  132. package/dist/transports/NativeTransport.js +397 -0
  133. package/dist/transports/NativeTransport.js.map +1 -0
  134. package/dist/transports/StdioTransport.d.ts +250 -0
  135. package/dist/transports/StdioTransport.d.ts.map +1 -0
  136. package/dist/transports/StdioTransport.js +487 -0
  137. package/dist/transports/StdioTransport.js.map +1 -0
  138. package/dist/transports/index.d.ts +10 -0
  139. package/dist/transports/index.d.ts.map +1 -0
  140. package/dist/transports/index.js +9 -0
  141. package/dist/transports/index.js.map +1 -0
  142. package/dist/types/broker.d.ts +279 -0
  143. package/dist/types/broker.d.ts.map +1 -0
  144. package/dist/types/broker.js +19 -0
  145. package/dist/types/broker.js.map +1 -0
  146. package/dist/types/config.d.ts +325 -0
  147. package/dist/types/config.d.ts.map +1 -0
  148. package/dist/types/config.js +17 -0
  149. package/dist/types/config.js.map +1 -0
  150. package/dist/types/errors.d.ts +178 -0
  151. package/dist/types/errors.d.ts.map +1 -0
  152. package/dist/types/errors.js +165 -0
  153. package/dist/types/errors.js.map +1 -0
  154. package/dist/types/events.d.ts +210 -0
  155. package/dist/types/events.d.ts.map +1 -0
  156. package/dist/types/events.js +8 -0
  157. package/dist/types/events.js.map +1 -0
  158. package/dist/types/index.d.ts +34 -0
  159. package/dist/types/index.d.ts.map +1 -0
  160. package/dist/types/index.js +21 -0
  161. package/dist/types/index.js.map +1 -0
  162. package/dist/types/protocol.d.ts +48 -0
  163. package/dist/types/protocol.d.ts.map +1 -0
  164. package/dist/types/protocol.js +11 -0
  165. package/dist/types/protocol.js.map +1 -0
  166. package/dist/types/tools.d.ts +67 -0
  167. package/dist/types/tools.d.ts.map +1 -0
  168. package/dist/types/tools.js +16 -0
  169. package/dist/types/tools.js.map +1 -0
  170. package/dist/types/transport.d.ts +250 -0
  171. package/dist/types/transport.d.ts.map +1 -0
  172. package/dist/types/transport.js +18 -0
  173. package/dist/types/transport.js.map +1 -0
  174. package/dist/types/zod-tools.d.ts +198 -0
  175. package/dist/types/zod-tools.d.ts.map +1 -0
  176. package/dist/types/zod-tools.js +14 -0
  177. package/dist/types/zod-tools.js.map +1 -0
  178. package/dist/utils/StdioMessageReader.d.ts +122 -0
  179. package/dist/utils/StdioMessageReader.d.ts.map +1 -0
  180. package/dist/utils/StdioMessageReader.js +209 -0
  181. package/dist/utils/StdioMessageReader.js.map +1 -0
  182. package/dist/utils/StdioMessageWriter.d.ts +104 -0
  183. package/dist/utils/StdioMessageWriter.d.ts.map +1 -0
  184. package/dist/utils/StdioMessageWriter.js +162 -0
  185. package/dist/utils/StdioMessageWriter.js.map +1 -0
  186. package/dist/validation/SchemaValidator.d.ts +208 -0
  187. package/dist/validation/SchemaValidator.d.ts.map +1 -0
  188. package/dist/validation/SchemaValidator.js +411 -0
  189. package/dist/validation/SchemaValidator.js.map +1 -0
  190. package/dist/validation/index.d.ts +11 -0
  191. package/dist/validation/index.d.ts.map +1 -0
  192. package/dist/validation/index.js +10 -0
  193. package/dist/validation/index.js.map +1 -0
  194. package/package.json +70 -5
  195. package/agent.json +0 -18
  196. package/broker.js +0 -214
  197. package/index.js +0 -370
  198. package/ipc.js +0 -220
  199. package/ipcInterfaces/pythonAbilityIPC.py +0 -177
@@ -0,0 +1,1399 @@
1
+ /**
2
+ * Model Context Protocol (MCP) Schema - Official Type Definitions
3
+ * ================================================================
4
+ *
5
+ * Source: https://github.com/modelcontextprotocol/specification
6
+ * Version: 2025-06-18
7
+ * License: MIT
8
+ *
9
+ * Copyright (c) 2024 Anthropic, PBC
10
+ *
11
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ * of this software and associated documentation files (the "Software"), to deal
13
+ * in the Software without restriction, including without limitation the rights
14
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ * copies of the Software, and to permit persons to whom the Software is
16
+ * furnished to do so, subject to the following conditions:
17
+ *
18
+ * The above copyright notice and this permission notice shall be included in all
19
+ * copies or substantial portions of the Software.
20
+ *
21
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ * SOFTWARE.
28
+ *
29
+ * ⚠️ DO NOT MODIFY THIS FILE MANUALLY
30
+ *
31
+ * This file is a verbatim copy of the official MCP schema. To update:
32
+ * 1. Check for new versions at https://github.com/modelcontextprotocol/specification
33
+ * 2. Copy the latest schema.ts from the repository
34
+ * 3. Replace this file entirely (preserving this header)
35
+ *
36
+ * Any modifications should be made in wrapper/adapter code, not here.
37
+ */
38
+ /**
39
+ * Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
40
+ *
41
+ * @internal
42
+ */
43
+ export type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResponse | JSONRPCError;
44
+ /** @internal */
45
+ export declare const LATEST_PROTOCOL_VERSION = "2025-06-18";
46
+ /** @internal */
47
+ export declare const JSONRPC_VERSION = "2.0";
48
+ /**
49
+ * A progress token, used to associate progress notifications with the original request.
50
+ */
51
+ export type ProgressToken = string | number;
52
+ /**
53
+ * An opaque token used to represent a cursor for pagination.
54
+ */
55
+ export type Cursor = string;
56
+ /** @internal */
57
+ export interface Request {
58
+ method: string;
59
+ params?: {
60
+ /**
61
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
62
+ */
63
+ _meta?: {
64
+ /**
65
+ * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
66
+ */
67
+ progressToken?: ProgressToken;
68
+ [key: string]: unknown;
69
+ };
70
+ [key: string]: unknown;
71
+ };
72
+ }
73
+ /** @internal */
74
+ export interface Notification {
75
+ method: string;
76
+ params?: {
77
+ /**
78
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
79
+ */
80
+ _meta?: {
81
+ [key: string]: unknown;
82
+ };
83
+ [key: string]: unknown;
84
+ };
85
+ }
86
+ export interface Result {
87
+ /**
88
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
89
+ */
90
+ _meta?: {
91
+ [key: string]: unknown;
92
+ };
93
+ [key: string]: unknown;
94
+ }
95
+ /**
96
+ * A uniquely identifying ID for a request in JSON-RPC.
97
+ */
98
+ export type RequestId = string | number;
99
+ /**
100
+ * A request that expects a response.
101
+ */
102
+ export interface JSONRPCRequest extends Request {
103
+ jsonrpc: typeof JSONRPC_VERSION;
104
+ id: RequestId;
105
+ }
106
+ /**
107
+ * A notification which does not expect a response.
108
+ */
109
+ export interface JSONRPCNotification extends Notification {
110
+ jsonrpc: typeof JSONRPC_VERSION;
111
+ }
112
+ /**
113
+ * A successful (non-error) response to a request.
114
+ */
115
+ export interface JSONRPCResponse {
116
+ jsonrpc: typeof JSONRPC_VERSION;
117
+ id: RequestId;
118
+ result: Result;
119
+ }
120
+ /** @internal */
121
+ export declare const PARSE_ERROR = -32700;
122
+ /** @internal */
123
+ export declare const INVALID_REQUEST = -32600;
124
+ /** @internal */
125
+ export declare const METHOD_NOT_FOUND = -32601;
126
+ /** @internal */
127
+ export declare const INVALID_PARAMS = -32602;
128
+ /** @internal */
129
+ export declare const INTERNAL_ERROR = -32603;
130
+ /**
131
+ * A response to a request that indicates an error occurred.
132
+ */
133
+ export interface JSONRPCError {
134
+ jsonrpc: typeof JSONRPC_VERSION;
135
+ id: RequestId;
136
+ error: {
137
+ /**
138
+ * The error type that occurred.
139
+ */
140
+ code: number;
141
+ /**
142
+ * A short description of the error. The message SHOULD be limited to a concise single sentence.
143
+ */
144
+ message: string;
145
+ /**
146
+ * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
147
+ */
148
+ data?: unknown;
149
+ };
150
+ }
151
+ /**
152
+ * A response that indicates success but carries no data.
153
+ */
154
+ export type EmptyResult = Result;
155
+ /**
156
+ * This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
157
+ *
158
+ * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
159
+ *
160
+ * This notification indicates that the result will be unused, so any associated processing SHOULD cease.
161
+ *
162
+ * A client MUST NOT attempt to cancel its `initialize` request.
163
+ *
164
+ * @category notifications/cancelled
165
+ */
166
+ export interface CancelledNotification extends Notification {
167
+ method: 'notifications/cancelled';
168
+ params: {
169
+ /**
170
+ * The ID of the request to cancel.
171
+ *
172
+ * This MUST correspond to the ID of a request previously issued in the same direction.
173
+ */
174
+ requestId: RequestId;
175
+ /**
176
+ * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
177
+ */
178
+ reason?: string;
179
+ };
180
+ }
181
+ /**
182
+ * This request is sent from the client to the server when it first connects, asking it to begin initialization.
183
+ *
184
+ * @category initialize
185
+ */
186
+ export interface InitializeRequest extends Request {
187
+ method: 'initialize';
188
+ params: {
189
+ /**
190
+ * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
191
+ */
192
+ protocolVersion: string;
193
+ capabilities: ClientCapabilities;
194
+ clientInfo: Implementation;
195
+ };
196
+ }
197
+ /**
198
+ * After receiving an initialize request from the client, the server sends this response.
199
+ *
200
+ * @category initialize
201
+ */
202
+ export interface InitializeResult extends Result {
203
+ /**
204
+ * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
205
+ */
206
+ protocolVersion: string;
207
+ capabilities: ServerCapabilities;
208
+ serverInfo: Implementation;
209
+ /**
210
+ * Instructions describing how to use the server and its features.
211
+ *
212
+ * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
213
+ */
214
+ instructions?: string;
215
+ }
216
+ /**
217
+ * This notification is sent from the client to the server after initialization has finished.
218
+ *
219
+ * @category notifications/initialized
220
+ */
221
+ export interface InitializedNotification extends Notification {
222
+ method: 'notifications/initialized';
223
+ }
224
+ /**
225
+ * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
226
+ */
227
+ export interface ClientCapabilities {
228
+ /**
229
+ * Experimental, non-standard capabilities that the client supports.
230
+ */
231
+ experimental?: {
232
+ [key: string]: object;
233
+ };
234
+ /**
235
+ * Present if the client supports listing roots.
236
+ */
237
+ roots?: {
238
+ /**
239
+ * Whether the client supports notifications for changes to the roots list.
240
+ */
241
+ listChanged?: boolean;
242
+ };
243
+ /**
244
+ * Present if the client supports sampling from an LLM.
245
+ */
246
+ sampling?: object;
247
+ /**
248
+ * Present if the client supports elicitation from the server.
249
+ */
250
+ elicitation?: object;
251
+ }
252
+ /**
253
+ * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
254
+ */
255
+ export interface ServerCapabilities {
256
+ /**
257
+ * Experimental, non-standard capabilities that the server supports.
258
+ */
259
+ experimental?: {
260
+ [key: string]: object;
261
+ };
262
+ /**
263
+ * Present if the server supports sending log messages to the client.
264
+ */
265
+ logging?: object;
266
+ /**
267
+ * Present if the server supports argument autocompletion suggestions.
268
+ */
269
+ completions?: object;
270
+ /**
271
+ * Present if the server offers any prompt templates.
272
+ */
273
+ prompts?: {
274
+ /**
275
+ * Whether this server supports notifications for changes to the prompt list.
276
+ */
277
+ listChanged?: boolean;
278
+ };
279
+ /**
280
+ * Present if the server offers any resources to read.
281
+ */
282
+ resources?: {
283
+ /**
284
+ * Whether this server supports subscribing to resource updates.
285
+ */
286
+ subscribe?: boolean;
287
+ /**
288
+ * Whether this server supports notifications for changes to the resource list.
289
+ */
290
+ listChanged?: boolean;
291
+ };
292
+ /**
293
+ * Present if the server offers any tools to call.
294
+ */
295
+ tools?: {
296
+ /**
297
+ * Whether this server supports notifications for changes to the tool list.
298
+ */
299
+ listChanged?: boolean;
300
+ };
301
+ }
302
+ /**
303
+ * Base interface for metadata with name (identifier) and title (display name) properties.
304
+ *
305
+ * @internal
306
+ */
307
+ export interface BaseMetadata {
308
+ /**
309
+ * Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
310
+ */
311
+ name: string;
312
+ /**
313
+ * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
314
+ * even by those unfamiliar with domain-specific terminology.
315
+ *
316
+ * If not provided, the name should be used for display (except for Tool,
317
+ * where `annotations.title` should be given precedence over using `name`,
318
+ * if present).
319
+ */
320
+ title?: string;
321
+ }
322
+ /**
323
+ * Describes the name and version of an MCP implementation, with an optional title for UI representation.
324
+ */
325
+ export interface Implementation extends BaseMetadata {
326
+ version: string;
327
+ }
328
+ /**
329
+ * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
330
+ *
331
+ * @category ping
332
+ */
333
+ export interface PingRequest extends Request {
334
+ method: 'ping';
335
+ }
336
+ /**
337
+ * An out-of-band notification used to inform the receiver of a progress update for a long-running request.
338
+ *
339
+ * @category notifications/progress
340
+ */
341
+ export interface ProgressNotification extends Notification {
342
+ method: 'notifications/progress';
343
+ params: {
344
+ /**
345
+ * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
346
+ */
347
+ progressToken: ProgressToken;
348
+ /**
349
+ * The progress thus far. This should increase every time progress is made, even if the total is unknown.
350
+ *
351
+ * @TJS-type number
352
+ */
353
+ progress: number;
354
+ /**
355
+ * Total number of items to process (or total progress required), if known.
356
+ *
357
+ * @TJS-type number
358
+ */
359
+ total?: number;
360
+ /**
361
+ * An optional message describing the current progress.
362
+ */
363
+ message?: string;
364
+ };
365
+ }
366
+ /** @internal */
367
+ export interface PaginatedRequest extends Request {
368
+ params?: {
369
+ /**
370
+ * An opaque token representing the current pagination position.
371
+ * If provided, the server should return results starting after this cursor.
372
+ */
373
+ cursor?: Cursor;
374
+ };
375
+ }
376
+ /** @internal */
377
+ export interface PaginatedResult extends Result {
378
+ /**
379
+ * An opaque token representing the pagination position after the last returned result.
380
+ * If present, there may be more results available.
381
+ */
382
+ nextCursor?: Cursor;
383
+ }
384
+ /**
385
+ * Sent from the client to request a list of resources the server has.
386
+ *
387
+ * @category resources/list
388
+ */
389
+ export interface ListResourcesRequest extends PaginatedRequest {
390
+ method: 'resources/list';
391
+ }
392
+ /**
393
+ * The server's response to a resources/list request from the client.
394
+ *
395
+ * @category resources/list
396
+ */
397
+ export interface ListResourcesResult extends PaginatedResult {
398
+ resources: Resource[];
399
+ }
400
+ /**
401
+ * Sent from the client to request a list of resource templates the server has.
402
+ *
403
+ * @category resources/templates/list
404
+ */
405
+ export interface ListResourceTemplatesRequest extends PaginatedRequest {
406
+ method: 'resources/templates/list';
407
+ }
408
+ /**
409
+ * The server's response to a resources/templates/list request from the client.
410
+ *
411
+ * @category resources/templates/list
412
+ */
413
+ export interface ListResourceTemplatesResult extends PaginatedResult {
414
+ resourceTemplates: ResourceTemplate[];
415
+ }
416
+ /**
417
+ * Sent from the client to the server, to read a specific resource URI.
418
+ *
419
+ * @category resources/read
420
+ */
421
+ export interface ReadResourceRequest extends Request {
422
+ method: 'resources/read';
423
+ params: {
424
+ /**
425
+ * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
426
+ *
427
+ * @format uri
428
+ */
429
+ uri: string;
430
+ };
431
+ }
432
+ /**
433
+ * The server's response to a resources/read request from the client.
434
+ *
435
+ * @category resources/read
436
+ */
437
+ export interface ReadResourceResult extends Result {
438
+ contents: (TextResourceContents | BlobResourceContents)[];
439
+ }
440
+ /**
441
+ * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
442
+ *
443
+ * @category notifications/resources/list_changed
444
+ */
445
+ export interface ResourceListChangedNotification extends Notification {
446
+ method: 'notifications/resources/list_changed';
447
+ }
448
+ /**
449
+ * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
450
+ *
451
+ * @category resources/subscribe
452
+ */
453
+ export interface SubscribeRequest extends Request {
454
+ method: 'resources/subscribe';
455
+ params: {
456
+ /**
457
+ * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
458
+ *
459
+ * @format uri
460
+ */
461
+ uri: string;
462
+ };
463
+ }
464
+ /**
465
+ * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
466
+ *
467
+ * @category resources/unsubscribe
468
+ */
469
+ export interface UnsubscribeRequest extends Request {
470
+ method: 'resources/unsubscribe';
471
+ params: {
472
+ /**
473
+ * The URI of the resource to unsubscribe from.
474
+ *
475
+ * @format uri
476
+ */
477
+ uri: string;
478
+ };
479
+ }
480
+ /**
481
+ * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
482
+ *
483
+ * @category notifications/resources/updated
484
+ */
485
+ export interface ResourceUpdatedNotification extends Notification {
486
+ method: 'notifications/resources/updated';
487
+ params: {
488
+ /**
489
+ * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
490
+ *
491
+ * @format uri
492
+ */
493
+ uri: string;
494
+ };
495
+ }
496
+ /**
497
+ * A known resource that the server is capable of reading.
498
+ */
499
+ export interface Resource extends BaseMetadata {
500
+ /**
501
+ * The URI of this resource.
502
+ *
503
+ * @format uri
504
+ */
505
+ uri: string;
506
+ /**
507
+ * A description of what this resource represents.
508
+ *
509
+ * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
510
+ */
511
+ description?: string;
512
+ /**
513
+ * The MIME type of this resource, if known.
514
+ */
515
+ mimeType?: string;
516
+ /**
517
+ * Optional annotations for the client.
518
+ */
519
+ annotations?: Annotations;
520
+ /**
521
+ * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
522
+ *
523
+ * This can be used by Hosts to display file sizes and estimate context window usage.
524
+ */
525
+ size?: number;
526
+ /**
527
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
528
+ */
529
+ _meta?: {
530
+ [key: string]: unknown;
531
+ };
532
+ }
533
+ /**
534
+ * A template description for resources available on the server.
535
+ */
536
+ export interface ResourceTemplate extends BaseMetadata {
537
+ /**
538
+ * A URI template (according to RFC 6570) that can be used to construct resource URIs.
539
+ *
540
+ * @format uri-template
541
+ */
542
+ uriTemplate: string;
543
+ /**
544
+ * A description of what this template is for.
545
+ *
546
+ * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
547
+ */
548
+ description?: string;
549
+ /**
550
+ * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
551
+ */
552
+ mimeType?: string;
553
+ /**
554
+ * Optional annotations for the client.
555
+ */
556
+ annotations?: Annotations;
557
+ /**
558
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
559
+ */
560
+ _meta?: {
561
+ [key: string]: unknown;
562
+ };
563
+ }
564
+ /**
565
+ * The contents of a specific resource or sub-resource.
566
+ */
567
+ export interface ResourceContents {
568
+ /**
569
+ * The URI of this resource.
570
+ *
571
+ * @format uri
572
+ */
573
+ uri: string;
574
+ /**
575
+ * The MIME type of this resource, if known.
576
+ */
577
+ mimeType?: string;
578
+ /**
579
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
580
+ */
581
+ _meta?: {
582
+ [key: string]: unknown;
583
+ };
584
+ }
585
+ export interface TextResourceContents extends ResourceContents {
586
+ /**
587
+ * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
588
+ */
589
+ text: string;
590
+ }
591
+ export interface BlobResourceContents extends ResourceContents {
592
+ /**
593
+ * A base64-encoded string representing the binary data of the item.
594
+ *
595
+ * @format byte
596
+ */
597
+ blob: string;
598
+ }
599
+ /**
600
+ * Sent from the client to request a list of prompts and prompt templates the server has.
601
+ *
602
+ * @category prompts/list
603
+ */
604
+ export interface ListPromptsRequest extends PaginatedRequest {
605
+ method: 'prompts/list';
606
+ }
607
+ /**
608
+ * The server's response to a prompts/list request from the client.
609
+ *
610
+ * @category prompts/list
611
+ */
612
+ export interface ListPromptsResult extends PaginatedResult {
613
+ prompts: Prompt[];
614
+ }
615
+ /**
616
+ * Used by the client to get a prompt provided by the server.
617
+ *
618
+ * @category prompts/get
619
+ */
620
+ export interface GetPromptRequest extends Request {
621
+ method: 'prompts/get';
622
+ params: {
623
+ /**
624
+ * The name of the prompt or prompt template.
625
+ */
626
+ name: string;
627
+ /**
628
+ * Arguments to use for templating the prompt.
629
+ */
630
+ arguments?: {
631
+ [key: string]: string;
632
+ };
633
+ };
634
+ }
635
+ /**
636
+ * The server's response to a prompts/get request from the client.
637
+ *
638
+ * @category prompts/get
639
+ */
640
+ export interface GetPromptResult extends Result {
641
+ /**
642
+ * An optional description for the prompt.
643
+ */
644
+ description?: string;
645
+ messages: PromptMessage[];
646
+ }
647
+ /**
648
+ * A prompt or prompt template that the server offers.
649
+ */
650
+ export interface Prompt extends BaseMetadata {
651
+ /**
652
+ * An optional description of what this prompt provides
653
+ */
654
+ description?: string;
655
+ /**
656
+ * A list of arguments to use for templating the prompt.
657
+ */
658
+ arguments?: PromptArgument[];
659
+ /**
660
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
661
+ */
662
+ _meta?: {
663
+ [key: string]: unknown;
664
+ };
665
+ }
666
+ /**
667
+ * Describes an argument that a prompt can accept.
668
+ */
669
+ export interface PromptArgument extends BaseMetadata {
670
+ /**
671
+ * A human-readable description of the argument.
672
+ */
673
+ description?: string;
674
+ /**
675
+ * Whether this argument must be provided.
676
+ */
677
+ required?: boolean;
678
+ }
679
+ /**
680
+ * The sender or recipient of messages and data in a conversation.
681
+ */
682
+ export type Role = 'user' | 'assistant';
683
+ /**
684
+ * Describes a message returned as part of a prompt.
685
+ *
686
+ * This is similar to `SamplingMessage`, but also supports the embedding of
687
+ * resources from the MCP server.
688
+ */
689
+ export interface PromptMessage {
690
+ role: Role;
691
+ content: ContentBlock;
692
+ }
693
+ /**
694
+ * A resource that the server is capable of reading, included in a prompt or tool call result.
695
+ *
696
+ * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
697
+ */
698
+ export interface ResourceLink extends Resource {
699
+ type: 'resource_link';
700
+ }
701
+ /**
702
+ * The contents of a resource, embedded into a prompt or tool call result.
703
+ *
704
+ * It is up to the client how best to render embedded resources for the benefit
705
+ * of the LLM and/or the user.
706
+ */
707
+ export interface EmbeddedResource {
708
+ type: 'resource';
709
+ resource: TextResourceContents | BlobResourceContents;
710
+ /**
711
+ * Optional annotations for the client.
712
+ */
713
+ annotations?: Annotations;
714
+ /**
715
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
716
+ */
717
+ _meta?: {
718
+ [key: string]: unknown;
719
+ };
720
+ }
721
+ /**
722
+ * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
723
+ *
724
+ * @category notifications/prompts/list_changed
725
+ */
726
+ export interface PromptListChangedNotification extends Notification {
727
+ method: 'notifications/prompts/list_changed';
728
+ }
729
+ /**
730
+ * Sent from the client to request a list of tools the server has.
731
+ *
732
+ * @category tools/list
733
+ */
734
+ export interface ListToolsRequest extends PaginatedRequest {
735
+ method: 'tools/list';
736
+ }
737
+ /**
738
+ * The server's response to a tools/list request from the client.
739
+ *
740
+ * @category tools/list
741
+ */
742
+ export interface ListToolsResult extends PaginatedResult {
743
+ tools: Tool[];
744
+ }
745
+ /**
746
+ * The server's response to a tool call.
747
+ *
748
+ * @category tools/call
749
+ */
750
+ export interface CallToolResult extends Result {
751
+ /**
752
+ * A list of content objects that represent the unstructured result of the tool call.
753
+ */
754
+ content: ContentBlock[];
755
+ /**
756
+ * An optional JSON object that represents the structured result of the tool call.
757
+ */
758
+ structuredContent?: {
759
+ [key: string]: unknown;
760
+ };
761
+ /**
762
+ * Whether the tool call ended in an error.
763
+ *
764
+ * If not set, this is assumed to be false (the call was successful).
765
+ *
766
+ * Any errors that originate from the tool SHOULD be reported inside the result
767
+ * object, with `isError` set to true, _not_ as an MCP protocol-level error
768
+ * response. Otherwise, the LLM would not be able to see that an error occurred
769
+ * and self-correct.
770
+ *
771
+ * However, any errors in _finding_ the tool, an error indicating that the
772
+ * server does not support tool calls, or any other exceptional conditions,
773
+ * should be reported as an MCP error response.
774
+ */
775
+ isError?: boolean;
776
+ }
777
+ /**
778
+ * Used by the client to invoke a tool provided by the server.
779
+ *
780
+ * @category tools/call
781
+ */
782
+ export interface CallToolRequest extends Request {
783
+ method: 'tools/call';
784
+ params: {
785
+ name: string;
786
+ arguments?: {
787
+ [key: string]: unknown;
788
+ };
789
+ };
790
+ }
791
+ /**
792
+ * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
793
+ *
794
+ * @category notifications/tools/list_changed
795
+ */
796
+ export interface ToolListChangedNotification extends Notification {
797
+ method: 'notifications/tools/list_changed';
798
+ }
799
+ /**
800
+ * Additional properties describing a Tool to clients.
801
+ *
802
+ * NOTE: all properties in ToolAnnotations are **hints**.
803
+ * They are not guaranteed to provide a faithful description of
804
+ * tool behavior (including descriptive properties like `title`).
805
+ *
806
+ * Clients should never make tool use decisions based on ToolAnnotations
807
+ * received from untrusted servers.
808
+ */
809
+ export interface ToolAnnotations {
810
+ /**
811
+ * A human-readable title for the tool.
812
+ */
813
+ title?: string;
814
+ /**
815
+ * If true, the tool does not modify its environment.
816
+ *
817
+ * Default: false
818
+ */
819
+ readOnlyHint?: boolean;
820
+ /**
821
+ * If true, the tool may perform destructive updates to its environment.
822
+ * If false, the tool performs only additive updates.
823
+ *
824
+ * (This property is meaningful only when `readOnlyHint == false`)
825
+ *
826
+ * Default: true
827
+ */
828
+ destructiveHint?: boolean;
829
+ /**
830
+ * If true, calling the tool repeatedly with the same arguments
831
+ * will have no additional effect on the its environment.
832
+ *
833
+ * (This property is meaningful only when `readOnlyHint == false`)
834
+ *
835
+ * Default: false
836
+ */
837
+ idempotentHint?: boolean;
838
+ /**
839
+ * If true, this tool may interact with an "open world" of external
840
+ * entities. If false, the tool's domain of interaction is closed.
841
+ * For example, the world of a web search tool is open, whereas that
842
+ * of a memory tool is not.
843
+ *
844
+ * Default: true
845
+ */
846
+ openWorldHint?: boolean;
847
+ }
848
+ /**
849
+ * Definition for a tool the client can call.
850
+ */
851
+ export interface Tool extends BaseMetadata {
852
+ /**
853
+ * A human-readable description of the tool.
854
+ *
855
+ * This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.
856
+ */
857
+ description?: string;
858
+ /**
859
+ * A JSON Schema object defining the expected parameters for the tool.
860
+ */
861
+ inputSchema: {
862
+ type: 'object';
863
+ properties?: {
864
+ [key: string]: object;
865
+ };
866
+ required?: string[];
867
+ };
868
+ /**
869
+ * An optional JSON Schema object defining the structure of the tool's output returned in
870
+ * the structuredContent field of a CallToolResult.
871
+ */
872
+ outputSchema?: {
873
+ type: 'object';
874
+ properties?: {
875
+ [key: string]: object;
876
+ };
877
+ required?: string[];
878
+ };
879
+ /**
880
+ * Optional additional tool information.
881
+ *
882
+ * Display name precedence order is: title, annotations.title, then name.
883
+ */
884
+ annotations?: ToolAnnotations;
885
+ /**
886
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
887
+ */
888
+ _meta?: {
889
+ [key: string]: unknown;
890
+ };
891
+ }
892
+ /**
893
+ * A request from the client to the server, to enable or adjust logging.
894
+ *
895
+ * @category logging/setLevel
896
+ */
897
+ export interface SetLevelRequest extends Request {
898
+ method: 'logging/setLevel';
899
+ params: {
900
+ /**
901
+ * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.
902
+ */
903
+ level: LoggingLevel;
904
+ };
905
+ }
906
+ /**
907
+ * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
908
+ *
909
+ * @category notifications/message
910
+ */
911
+ export interface LoggingMessageNotification extends Notification {
912
+ method: 'notifications/message';
913
+ params: {
914
+ /**
915
+ * The severity of this log message.
916
+ */
917
+ level: LoggingLevel;
918
+ /**
919
+ * An optional name of the logger issuing this message.
920
+ */
921
+ logger?: string;
922
+ /**
923
+ * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
924
+ */
925
+ data: unknown;
926
+ };
927
+ }
928
+ /**
929
+ * The severity of a log message.
930
+ *
931
+ * These map to syslog message severities, as specified in RFC-5424:
932
+ * https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
933
+ */
934
+ export type LoggingLevel = 'debug' | 'info' | 'notice' | 'warning' | 'error' | 'critical' | 'alert' | 'emergency';
935
+ /**
936
+ * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
937
+ *
938
+ * @category sampling/createMessage
939
+ */
940
+ export interface CreateMessageRequest extends Request {
941
+ method: 'sampling/createMessage';
942
+ params: {
943
+ messages: SamplingMessage[];
944
+ /**
945
+ * The server's preferences for which model to select. The client MAY ignore these preferences.
946
+ */
947
+ modelPreferences?: ModelPreferences;
948
+ /**
949
+ * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
950
+ */
951
+ systemPrompt?: string;
952
+ /**
953
+ * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
954
+ */
955
+ includeContext?: 'none' | 'thisServer' | 'allServers';
956
+ /**
957
+ * @TJS-type number
958
+ */
959
+ temperature?: number;
960
+ /**
961
+ * The requested maximum number of tokens to sample (to prevent runaway completions).
962
+ *
963
+ * The client MAY choose to sample fewer tokens than the requested maximum.
964
+ */
965
+ maxTokens: number;
966
+ stopSequences?: string[];
967
+ /**
968
+ * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
969
+ */
970
+ metadata?: object;
971
+ };
972
+ }
973
+ /**
974
+ * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
975
+ *
976
+ * @category sampling/createMessage
977
+ */
978
+ export interface CreateMessageResult extends Result, SamplingMessage {
979
+ /**
980
+ * The name of the model that generated the message.
981
+ */
982
+ model: string;
983
+ /**
984
+ * The reason why sampling stopped, if known.
985
+ */
986
+ stopReason?: 'endTurn' | 'stopSequence' | 'maxTokens' | string;
987
+ }
988
+ /**
989
+ * Describes a message issued to or received from an LLM API.
990
+ */
991
+ export interface SamplingMessage {
992
+ role: Role;
993
+ content: TextContent | ImageContent | AudioContent;
994
+ }
995
+ /**
996
+ * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
997
+ */
998
+ export interface Annotations {
999
+ /**
1000
+ * Describes who the intended customer of this object or data is.
1001
+ *
1002
+ * It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`).
1003
+ */
1004
+ audience?: Role[];
1005
+ /**
1006
+ * Describes how important this data is for operating the server.
1007
+ *
1008
+ * A value of 1 means "most important," and indicates that the data is
1009
+ * effectively required, while 0 means "least important," and indicates that
1010
+ * the data is entirely optional.
1011
+ *
1012
+ * @TJS-type number
1013
+ * @minimum 0
1014
+ * @maximum 1
1015
+ */
1016
+ priority?: number;
1017
+ /**
1018
+ * The moment the resource was last modified, as an ISO 8601 formatted string.
1019
+ *
1020
+ * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
1021
+ *
1022
+ * Examples: last activity timestamp in an open file, timestamp when the resource
1023
+ * was attached, etc.
1024
+ */
1025
+ lastModified?: string;
1026
+ }
1027
+ export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource;
1028
+ /**
1029
+ * Text provided to or from an LLM.
1030
+ */
1031
+ export interface TextContent {
1032
+ type: 'text';
1033
+ /**
1034
+ * The text content of the message.
1035
+ */
1036
+ text: string;
1037
+ /**
1038
+ * Optional annotations for the client.
1039
+ */
1040
+ annotations?: Annotations;
1041
+ /**
1042
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
1043
+ */
1044
+ _meta?: {
1045
+ [key: string]: unknown;
1046
+ };
1047
+ }
1048
+ /**
1049
+ * An image provided to or from an LLM.
1050
+ */
1051
+ export interface ImageContent {
1052
+ type: 'image';
1053
+ /**
1054
+ * The base64-encoded image data.
1055
+ *
1056
+ * @format byte
1057
+ */
1058
+ data: string;
1059
+ /**
1060
+ * The MIME type of the image. Different providers may support different image types.
1061
+ */
1062
+ mimeType: string;
1063
+ /**
1064
+ * Optional annotations for the client.
1065
+ */
1066
+ annotations?: Annotations;
1067
+ /**
1068
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
1069
+ */
1070
+ _meta?: {
1071
+ [key: string]: unknown;
1072
+ };
1073
+ }
1074
+ /**
1075
+ * Audio provided to or from an LLM.
1076
+ */
1077
+ export interface AudioContent {
1078
+ type: 'audio';
1079
+ /**
1080
+ * The base64-encoded audio data.
1081
+ *
1082
+ * @format byte
1083
+ */
1084
+ data: string;
1085
+ /**
1086
+ * The MIME type of the audio. Different providers may support different audio types.
1087
+ */
1088
+ mimeType: string;
1089
+ /**
1090
+ * Optional annotations for the client.
1091
+ */
1092
+ annotations?: Annotations;
1093
+ /**
1094
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
1095
+ */
1096
+ _meta?: {
1097
+ [key: string]: unknown;
1098
+ };
1099
+ }
1100
+ /**
1101
+ * The server's preferences for model selection, requested of the client during sampling.
1102
+ *
1103
+ * Because LLMs can vary along multiple dimensions, choosing the "best" model is
1104
+ * rarely straightforward. Different models excel in different areas—some are
1105
+ * faster but less capable, others are more capable but more expensive, and so
1106
+ * on. This interface allows servers to express their priorities across multiple
1107
+ * dimensions to help clients make an appropriate selection for their use case.
1108
+ *
1109
+ * These preferences are always advisory. The client MAY ignore them. It is also
1110
+ * up to the client to decide how to interpret these preferences and how to
1111
+ * balance them against other considerations.
1112
+ */
1113
+ export interface ModelPreferences {
1114
+ /**
1115
+ * Optional hints to use for model selection.
1116
+ *
1117
+ * If multiple hints are specified, the client MUST evaluate them in order
1118
+ * (such that the first match is taken).
1119
+ *
1120
+ * The client SHOULD prioritize these hints over the numeric priorities, but
1121
+ * MAY still use the priorities to select from ambiguous matches.
1122
+ */
1123
+ hints?: ModelHint[];
1124
+ /**
1125
+ * How much to prioritize cost when selecting a model. A value of 0 means cost
1126
+ * is not important, while a value of 1 means cost is the most important
1127
+ * factor.
1128
+ *
1129
+ * @TJS-type number
1130
+ * @minimum 0
1131
+ * @maximum 1
1132
+ */
1133
+ costPriority?: number;
1134
+ /**
1135
+ * How much to prioritize sampling speed (latency) when selecting a model. A
1136
+ * value of 0 means speed is not important, while a value of 1 means speed is
1137
+ * the most important factor.
1138
+ *
1139
+ * @TJS-type number
1140
+ * @minimum 0
1141
+ * @maximum 1
1142
+ */
1143
+ speedPriority?: number;
1144
+ /**
1145
+ * How much to prioritize intelligence and capabilities when selecting a
1146
+ * model. A value of 0 means intelligence is not important, while a value of 1
1147
+ * means intelligence is the most important factor.
1148
+ *
1149
+ * @TJS-type number
1150
+ * @minimum 0
1151
+ * @maximum 1
1152
+ */
1153
+ intelligencePriority?: number;
1154
+ }
1155
+ /**
1156
+ * Hints to use for model selection.
1157
+ *
1158
+ * Keys not declared here are currently left unspecified by the spec and are up
1159
+ * to the client to interpret.
1160
+ */
1161
+ export interface ModelHint {
1162
+ /**
1163
+ * A hint for a model name.
1164
+ *
1165
+ * The client SHOULD treat this as a substring of a model name; for example:
1166
+ * - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
1167
+ * - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
1168
+ * - `claude` should match any Claude model
1169
+ *
1170
+ * The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
1171
+ * - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
1172
+ */
1173
+ name?: string;
1174
+ }
1175
+ /**
1176
+ * A request from the client to the server, to ask for completion options.
1177
+ *
1178
+ * @category completion/complete
1179
+ */
1180
+ export interface CompleteRequest extends Request {
1181
+ method: 'completion/complete';
1182
+ params: {
1183
+ ref: PromptReference | ResourceTemplateReference;
1184
+ /**
1185
+ * The argument's information
1186
+ */
1187
+ argument: {
1188
+ /**
1189
+ * The name of the argument
1190
+ */
1191
+ name: string;
1192
+ /**
1193
+ * The value of the argument to use for completion matching.
1194
+ */
1195
+ value: string;
1196
+ };
1197
+ /**
1198
+ * Additional, optional context for completions
1199
+ */
1200
+ context?: {
1201
+ /**
1202
+ * Previously-resolved variables in a URI template or prompt.
1203
+ */
1204
+ arguments?: {
1205
+ [key: string]: string;
1206
+ };
1207
+ };
1208
+ };
1209
+ }
1210
+ /**
1211
+ * The server's response to a completion/complete request
1212
+ *
1213
+ * @category completion/complete
1214
+ */
1215
+ export interface CompleteResult extends Result {
1216
+ completion: {
1217
+ /**
1218
+ * An array of completion values. Must not exceed 100 items.
1219
+ */
1220
+ values: string[];
1221
+ /**
1222
+ * The total number of completion options available. This can exceed the number of values actually sent in the response.
1223
+ */
1224
+ total?: number;
1225
+ /**
1226
+ * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
1227
+ */
1228
+ hasMore?: boolean;
1229
+ };
1230
+ }
1231
+ /**
1232
+ * A reference to a resource or resource template definition.
1233
+ */
1234
+ export interface ResourceTemplateReference {
1235
+ type: 'ref/resource';
1236
+ /**
1237
+ * The URI or URI template of the resource.
1238
+ *
1239
+ * @format uri-template
1240
+ */
1241
+ uri: string;
1242
+ }
1243
+ /**
1244
+ * Identifies a prompt.
1245
+ */
1246
+ export interface PromptReference extends BaseMetadata {
1247
+ type: 'ref/prompt';
1248
+ }
1249
+ /**
1250
+ * Sent from the server to request a list of root URIs from the client. Roots allow
1251
+ * servers to ask for specific directories or files to operate on. A common example
1252
+ * for roots is providing a set of repositories or directories a server should operate
1253
+ * on.
1254
+ *
1255
+ * This request is typically used when the server needs to understand the file system
1256
+ * structure or access specific locations that the client has permission to read from.
1257
+ *
1258
+ * @category roots/list
1259
+ */
1260
+ export interface ListRootsRequest extends Request {
1261
+ method: 'roots/list';
1262
+ }
1263
+ /**
1264
+ * The client's response to a roots/list request from the server.
1265
+ * This result contains an array of Root objects, each representing a root directory
1266
+ * or file that the server can operate on.
1267
+ *
1268
+ * @category roots/list
1269
+ */
1270
+ export interface ListRootsResult extends Result {
1271
+ roots: Root[];
1272
+ }
1273
+ /**
1274
+ * Represents a root directory or file that the server can operate on.
1275
+ */
1276
+ export interface Root {
1277
+ /**
1278
+ * The URI identifying the root. This *must* start with file:// for now.
1279
+ * This restriction may be relaxed in future versions of the protocol to allow
1280
+ * other URI schemes.
1281
+ *
1282
+ * @format uri
1283
+ */
1284
+ uri: string;
1285
+ /**
1286
+ * An optional name for the root. This can be used to provide a human-readable
1287
+ * identifier for the root, which may be useful for display purposes or for
1288
+ * referencing the root in other parts of the application.
1289
+ */
1290
+ name?: string;
1291
+ /**
1292
+ * See [General fields: `_meta`](/specification/2025-06-18/basic/index#meta) for notes on `_meta` usage.
1293
+ */
1294
+ _meta?: {
1295
+ [key: string]: unknown;
1296
+ };
1297
+ }
1298
+ /**
1299
+ * A notification from the client to the server, informing it that the list of roots has changed.
1300
+ * This notification should be sent whenever the client adds, removes, or modifies any root.
1301
+ * The server should then request an updated list of roots using the ListRootsRequest.
1302
+ *
1303
+ * @category notifications/roots/list_changed
1304
+ */
1305
+ export interface RootsListChangedNotification extends Notification {
1306
+ method: 'notifications/roots/list_changed';
1307
+ }
1308
+ /**
1309
+ * A request from the server to elicit additional information from the user via the client.
1310
+ *
1311
+ * @category elicitation/create
1312
+ */
1313
+ export interface ElicitRequest extends Request {
1314
+ method: 'elicitation/create';
1315
+ params: {
1316
+ /**
1317
+ * The message to present to the user.
1318
+ */
1319
+ message: string;
1320
+ /**
1321
+ * A restricted subset of JSON Schema.
1322
+ * Only top-level properties are allowed, without nesting.
1323
+ */
1324
+ requestedSchema: {
1325
+ type: 'object';
1326
+ properties: {
1327
+ [key: string]: PrimitiveSchemaDefinition;
1328
+ };
1329
+ required?: string[];
1330
+ };
1331
+ };
1332
+ }
1333
+ /**
1334
+ * Restricted schema definitions that only allow primitive types
1335
+ * without nested objects or arrays.
1336
+ */
1337
+ export type PrimitiveSchemaDefinition = StringSchema | NumberSchema | BooleanSchema | EnumSchema;
1338
+ export interface StringSchema {
1339
+ type: 'string';
1340
+ title?: string;
1341
+ description?: string;
1342
+ minLength?: number;
1343
+ maxLength?: number;
1344
+ format?: 'email' | 'uri' | 'date' | 'date-time';
1345
+ }
1346
+ export interface NumberSchema {
1347
+ type: 'number' | 'integer';
1348
+ title?: string;
1349
+ description?: string;
1350
+ minimum?: number;
1351
+ maximum?: number;
1352
+ }
1353
+ export interface BooleanSchema {
1354
+ type: 'boolean';
1355
+ title?: string;
1356
+ description?: string;
1357
+ default?: boolean;
1358
+ }
1359
+ export interface EnumSchema {
1360
+ type: 'string';
1361
+ title?: string;
1362
+ description?: string;
1363
+ enum: string[];
1364
+ enumNames?: string[];
1365
+ }
1366
+ /**
1367
+ * The client's response to an elicitation request.
1368
+ *
1369
+ * @category elicitation/create
1370
+ */
1371
+ export interface ElicitResult extends Result {
1372
+ /**
1373
+ * The user action in response to the elicitation.
1374
+ * - "accept": User submitted the form/confirmed the action
1375
+ * - "decline": User explicitly declined the action
1376
+ * - "cancel": User dismissed without making an explicit choice
1377
+ */
1378
+ action: 'accept' | 'decline' | 'cancel';
1379
+ /**
1380
+ * The submitted form data, only present when action is "accept".
1381
+ * Contains values matching the requested schema.
1382
+ */
1383
+ content?: {
1384
+ [key: string]: string | number | boolean;
1385
+ };
1386
+ }
1387
+ /** @internal */
1388
+ export type ClientRequest = PingRequest | InitializeRequest | CompleteRequest | SetLevelRequest | GetPromptRequest | ListPromptsRequest | ListResourcesRequest | ListResourceTemplatesRequest | ReadResourceRequest | SubscribeRequest | UnsubscribeRequest | CallToolRequest | ListToolsRequest;
1389
+ /** @internal */
1390
+ export type ClientNotification = CancelledNotification | ProgressNotification | InitializedNotification | RootsListChangedNotification;
1391
+ /** @internal */
1392
+ export type ClientResult = EmptyResult | CreateMessageResult | ListRootsResult | ElicitResult;
1393
+ /** @internal */
1394
+ export type ServerRequest = PingRequest | CreateMessageRequest | ListRootsRequest | ElicitRequest;
1395
+ /** @internal */
1396
+ export type ServerNotification = CancelledNotification | ProgressNotification | LoggingMessageNotification | ResourceUpdatedNotification | ResourceListChangedNotification | ToolListChangedNotification | PromptListChangedNotification;
1397
+ /** @internal */
1398
+ export type ServerResult = EmptyResult | InitializeResult | CompleteResult | GetPromptResult | ListPromptsResult | ListResourceTemplatesResult | ListResourcesResult | ReadResourceResult | CallToolResult | ListToolsResult;
1399
+ //# sourceMappingURL=schema.d.ts.map