tmcp 1.16.0 → 1.16.2
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.
- package/README.md +8 -1
- package/package.json +1 -1
- package/src/index.js +44 -19
- package/src/internal/internal.d.ts +1 -1
- package/src/types/index.d.ts +522 -11
- package/src/types/index.d.ts.map +14 -4
- package/src/validation/index.js +18 -0
package/README.md
CHANGED
|
@@ -57,6 +57,10 @@ const server = new McpServer(
|
|
|
57
57
|
},
|
|
58
58
|
);
|
|
59
59
|
|
|
60
|
+
// While the adapter is optional (you can opt out by explicitly passing `adapter: undefined`)
|
|
61
|
+
// without an adapter the server cannot accept inputs, produce structured outputs, or request
|
|
62
|
+
// elicitations at all only do this for very simple servers.
|
|
63
|
+
|
|
60
64
|
// Define a tool with type-safe schema
|
|
61
65
|
server.tool(
|
|
62
66
|
{
|
|
@@ -107,7 +111,10 @@ new McpServer(serverInfo, options);
|
|
|
107
111
|
```
|
|
108
112
|
|
|
109
113
|
- `serverInfo`: Server metadata (name, version, description)
|
|
110
|
-
- `options`: Configuration object with adapter and capabilities
|
|
114
|
+
- `options`: Configuration object with optional adapter (for schema conversion) and capabilities
|
|
115
|
+
|
|
116
|
+
> [!IMPORTANT]
|
|
117
|
+
> While the adapter is optional (you can opt out by explicitly passing `adapter: undefined`) without an adapter the server cannot accept inputs, produce structured outputs, or request elicitations at all only do this for very simple servers.
|
|
111
118
|
|
|
112
119
|
#### Methods
|
|
113
120
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @import SqidsType from "sqids";
|
|
5
5
|
* @import { JSONRPCRequest, JSONRPCParams } from "json-rpc-2.0";
|
|
6
6
|
* @import { ExtractURITemplateVariables } from "./internal/uri-template.js";
|
|
7
|
-
* @import { CallToolResult as CallToolResultType, ReadResourceResult as ReadResourceResultType, GetPromptResult as GetPromptResultType, ServerInfo as ServerInfoType, ClientCapabilities as ClientCapabilitiesType, JSONRPCRequest as JSONRPCRequestType, JSONRPCResponse, CreateMessageRequestParams as CreateMessageRequestParamsType, CreateMessageResult as CreateMessageResultType, Resource as ResourceType, LoggingLevel as LoggingLevelType, ToolAnnotations, ClientInfo as ClientInfoType, ElicitResult as ElicitResultType, Icons as IconsType } from "./validation/index.js";
|
|
7
|
+
* @import { CallToolResult as CallToolResultType, ReadResourceResult as ReadResourceResultType, GetPromptResult as GetPromptResultType, ServerInfo as ServerInfoType, ClientCapabilities as ClientCapabilitiesType, JSONRPCRequest as JSONRPCRequestType, JSONRPCResponse, CreateMessageRequestParams as CreateMessageRequestParamsType, CreateMessageResult as CreateMessageResultType, Resource as ResourceType, LoggingLevel as LoggingLevelType, ToolAnnotations, ClientInfo as ClientInfoType, ElicitResult as ElicitResultType, Icons as IconsType, JSONRPCMessage, InitializeResult as InitializeResultType, ListToolsResult as ListToolsResultType, ListPromptsResult as ListPromptsResultType, ListResourceTemplatesResult as ListResourceTemplatesResultType, ListResourcesResult as ListResourcesResultType, CompleteResult as CompleteResultType } from "./validation/index.js";
|
|
8
8
|
* @import { Tool, Completion, Prompt, StoredResource, ServerOptions, SubscriptionsKeys, ChangedArgs, McpEvents } from "./internal/internal.js";
|
|
9
9
|
*/
|
|
10
10
|
import { JSONRPCClient, JSONRPCServer } from 'json-rpc-2.0';
|
|
@@ -107,6 +107,29 @@ import { should_version_negotiation_fail } from './validation/version.js';
|
|
|
107
107
|
* @typedef {ElicitResultType} ElicitResult
|
|
108
108
|
*/
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @typedef {InitializeResultType} InitializeResult
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @typedef {ListToolsResultType} ListToolsResult
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @typedef {ListPromptsResultType} ListPromptsResult
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @typedef {ListResourceTemplatesResultType} ListResourceTemplatesResult
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @typedef {ListResourcesResultType} ListResourcesResult
|
|
128
|
+
*/
|
|
129
|
+
/**
|
|
130
|
+
* @typedef {CompleteResultType} CompleteResult
|
|
131
|
+
*/
|
|
132
|
+
|
|
110
133
|
/**
|
|
111
134
|
* @type {SqidsType | undefined}
|
|
112
135
|
*/
|
|
@@ -398,12 +421,13 @@ export class McpServer {
|
|
|
398
421
|
description: tool.description,
|
|
399
422
|
icons: tool.icons,
|
|
400
423
|
_meta: tool._meta,
|
|
401
|
-
inputSchema:
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
424
|
+
inputSchema:
|
|
425
|
+
tool.schema && this.#options.adapter
|
|
426
|
+
? await this.#options.adapter.toJsonSchema(
|
|
427
|
+
tool.schema,
|
|
428
|
+
)
|
|
429
|
+
: { type: 'object', properties: {} },
|
|
430
|
+
...(tool.outputSchema && this.#options.adapter
|
|
407
431
|
? {
|
|
408
432
|
outputSchema:
|
|
409
433
|
await this.#options.adapter.toJsonSchema(
|
|
@@ -515,16 +539,17 @@ export class McpServer {
|
|
|
515
539
|
(await safe_enabled(prompt.enabled)) === false
|
|
516
540
|
)
|
|
517
541
|
return null;
|
|
518
|
-
const arguments_schema =
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
542
|
+
const arguments_schema =
|
|
543
|
+
prompt.schema && this.#options.adapter
|
|
544
|
+
? await this.#options.adapter.toJsonSchema(
|
|
545
|
+
prompt.schema,
|
|
546
|
+
)
|
|
547
|
+
: {
|
|
548
|
+
type: 'object',
|
|
549
|
+
properties:
|
|
550
|
+
/** @type {Record<string, {description: string}>} */ ({}),
|
|
551
|
+
required: [],
|
|
552
|
+
};
|
|
528
553
|
const keys = Object.keys(
|
|
529
554
|
arguments_schema.properties ?? {},
|
|
530
555
|
);
|
|
@@ -956,7 +981,7 @@ export class McpServer {
|
|
|
956
981
|
/**
|
|
957
982
|
* The main function that receive a JSONRpc message and either dispatch a `send` event or process the request.
|
|
958
983
|
*
|
|
959
|
-
* @param {
|
|
984
|
+
* @param {JSONRPCMessage} message
|
|
960
985
|
* @param {Context<CustomContext>} [ctx]
|
|
961
986
|
* @returns {ReturnType<JSONRPCServer['receive']> | ReturnType<JSONRPCClient['receive'] | undefined>}
|
|
962
987
|
*/
|
|
@@ -1045,7 +1070,7 @@ export class McpServer {
|
|
|
1045
1070
|
{
|
|
1046
1071
|
message,
|
|
1047
1072
|
requestedSchema:
|
|
1048
|
-
await this.#options.adapter
|
|
1073
|
+
await this.#options.adapter?.toJsonSchema(schema),
|
|
1049
1074
|
},
|
|
1050
1075
|
'standalone',
|
|
1051
1076
|
);
|
|
@@ -71,7 +71,7 @@ export type StoredResource =
|
|
|
71
71
|
export type ServerOptions<TSchema extends StandardSchemaV1 | undefined> = {
|
|
72
72
|
capabilities?: ServerCapabilities;
|
|
73
73
|
instructions?: string;
|
|
74
|
-
adapter: JsonSchemaAdapter<TSchema
|
|
74
|
+
adapter: JsonSchemaAdapter<TSchema> | undefined;
|
|
75
75
|
pagination?: {
|
|
76
76
|
resources?: { size?: number };
|
|
77
77
|
prompts?: { size?: number };
|
package/src/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare module 'tmcp' {
|
|
2
2
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
|
-
import type {
|
|
3
|
+
import type { JSONRPCServer, JSONRPCClient, JSONRPCRequest } from 'json-rpc-2.0';
|
|
4
4
|
import type { JSONSchema7 } from 'json-schema';
|
|
5
5
|
import * as v from 'valibot';
|
|
6
6
|
export class McpServer<StandardSchema extends StandardSchemaV1 | undefined = undefined, CustomContext extends Record<string, unknown> | undefined = undefined> {
|
|
@@ -112,7 +112,7 @@ declare module 'tmcp' {
|
|
|
112
112
|
* The main function that receive a JSONRpc message and either dispatch a `send` event or process the request.
|
|
113
113
|
*
|
|
114
114
|
* */
|
|
115
|
-
receive(message:
|
|
115
|
+
receive(message: JSONRPCMessage, ctx?: Context<CustomContext>): ReturnType<JSONRPCServer["receive"]> | ReturnType<JSONRPCClient["receive"] | undefined>;
|
|
116
116
|
/**
|
|
117
117
|
* Send a notification for subscriptions
|
|
118
118
|
* */
|
|
@@ -206,15 +206,21 @@ declare module 'tmcp' {
|
|
|
206
206
|
export type LoggingLevel = LoggingLevel_1;
|
|
207
207
|
export type ClientInfo = ClientInfo_1;
|
|
208
208
|
export type ElicitResult = ElicitResult_1;
|
|
209
|
+
export type InitializeResult = InitializeResult_1;
|
|
210
|
+
export type ListToolsResult = ListToolsResult_1;
|
|
211
|
+
export type ListPromptsResult = ListPromptsResult_1;
|
|
212
|
+
export type ListResourceTemplatesResult = ListResourceTemplatesResult_1;
|
|
213
|
+
export type ListResourcesResult = ListResourcesResult_1;
|
|
214
|
+
export type CompleteResult = CompleteResult_1;
|
|
209
215
|
type Completion = (
|
|
210
216
|
query: string,
|
|
211
217
|
context: { arguments: Record<string, string> },
|
|
212
|
-
) =>
|
|
218
|
+
) => CompleteResult_1 | Promise<CompleteResult_1>;
|
|
213
219
|
|
|
214
220
|
type ServerOptions<TSchema extends StandardSchemaV1 | undefined> = {
|
|
215
221
|
capabilities?: ServerCapabilities;
|
|
216
222
|
instructions?: string;
|
|
217
|
-
adapter: JsonSchemaAdapter<TSchema
|
|
223
|
+
adapter: JsonSchemaAdapter<TSchema> | undefined;
|
|
218
224
|
pagination?: {
|
|
219
225
|
resources?: { size?: number };
|
|
220
226
|
prompts?: { size?: number };
|
|
@@ -248,10 +254,29 @@ declare module 'tmcp' {
|
|
|
248
254
|
subscription: (subscriptions_request: { uri: string }) => void;
|
|
249
255
|
loglevelchange: (change: { level: LoggingLevel_1 }) => void;
|
|
250
256
|
};
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
257
|
+
const JSONRPCMessageSchema: v.UnionSchema<[v.ObjectSchema<{
|
|
258
|
+
readonly method: v.StringSchema<undefined>;
|
|
259
|
+
readonly params: v.OptionalSchema<v.LooseObjectSchema<{
|
|
260
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{
|
|
261
|
+
/**
|
|
262
|
+
* 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.
|
|
263
|
+
*/
|
|
264
|
+
readonly progressToken: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>, undefined>;
|
|
265
|
+
}, undefined>, undefined>;
|
|
266
|
+
}, undefined>, undefined>;
|
|
267
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
268
|
+
readonly id: v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>;
|
|
269
|
+
}, undefined>, v.ObjectSchema<{
|
|
270
|
+
readonly method: v.StringSchema<undefined>;
|
|
271
|
+
readonly params: v.OptionalSchema<v.LooseObjectSchema<{
|
|
272
|
+
/**
|
|
273
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
274
|
+
* for notes on _meta usage.
|
|
275
|
+
*/
|
|
276
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
277
|
+
}, undefined>, undefined>;
|
|
278
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
279
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
255
280
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
256
281
|
readonly id: v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>;
|
|
257
282
|
readonly result: v.LooseObjectSchema<{
|
|
@@ -261,7 +286,24 @@ declare module 'tmcp' {
|
|
|
261
286
|
*/
|
|
262
287
|
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
263
288
|
}, undefined>;
|
|
264
|
-
}, undefined
|
|
289
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
290
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
291
|
+
readonly id: v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>], undefined>;
|
|
292
|
+
readonly error: v.ObjectSchema<{
|
|
293
|
+
/**
|
|
294
|
+
* The error type that occurred.
|
|
295
|
+
*/
|
|
296
|
+
readonly code: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
297
|
+
/**
|
|
298
|
+
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
299
|
+
*/
|
|
300
|
+
readonly message: v.StringSchema<undefined>;
|
|
301
|
+
/**
|
|
302
|
+
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
303
|
+
*/
|
|
304
|
+
readonly data: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
305
|
+
}, undefined>;
|
|
306
|
+
}, undefined>], undefined>;
|
|
265
307
|
const IconsSchema: v.ObjectSchema<{
|
|
266
308
|
/**
|
|
267
309
|
* Optional set of sized icons that the client can display in a user interface.
|
|
@@ -490,6 +532,114 @@ declare module 'tmcp' {
|
|
|
490
532
|
readonly listChanged: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
491
533
|
}, undefined>, undefined>;
|
|
492
534
|
}, undefined>;
|
|
535
|
+
/**
|
|
536
|
+
* After receiving an initialize request from the client, the server sends this response.
|
|
537
|
+
*/
|
|
538
|
+
const InitializeResultSchema: v.ObjectSchema<{
|
|
539
|
+
/**
|
|
540
|
+
* 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.
|
|
541
|
+
*/
|
|
542
|
+
readonly protocolVersion: v.StringSchema<undefined>;
|
|
543
|
+
readonly capabilities: v.ObjectSchema<{
|
|
544
|
+
/**
|
|
545
|
+
* Experimental, non-standard capabilities that the server supports.
|
|
546
|
+
*/
|
|
547
|
+
readonly experimental: v.OptionalSchema<v.ObjectSchema<{}, undefined>, undefined>;
|
|
548
|
+
/**
|
|
549
|
+
* Present if the server supports sending log messages to the client.
|
|
550
|
+
*/
|
|
551
|
+
readonly logging: v.OptionalSchema<v.ObjectSchema<{}, undefined>, undefined>;
|
|
552
|
+
/**
|
|
553
|
+
* Present if the server supports sending completions to the client.
|
|
554
|
+
*/
|
|
555
|
+
readonly completions: v.OptionalSchema<v.ObjectSchema<{}, undefined>, undefined>;
|
|
556
|
+
/**
|
|
557
|
+
* Present if the server offers any prompt templates.
|
|
558
|
+
*/
|
|
559
|
+
readonly prompts: v.OptionalSchema<v.ObjectSchema<{
|
|
560
|
+
/**
|
|
561
|
+
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
562
|
+
*/
|
|
563
|
+
readonly listChanged: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
564
|
+
}, undefined>, undefined>;
|
|
565
|
+
/**
|
|
566
|
+
* Present if the server offers any resources to read.
|
|
567
|
+
*/
|
|
568
|
+
readonly resources: v.OptionalSchema<v.ObjectSchema<{
|
|
569
|
+
/**
|
|
570
|
+
* Whether this server supports clients subscribing to resource updates.
|
|
571
|
+
*/
|
|
572
|
+
readonly subscribe: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
573
|
+
/**
|
|
574
|
+
* Whether this server supports issuing notifications for changes to the resource list.
|
|
575
|
+
*/
|
|
576
|
+
readonly listChanged: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
577
|
+
}, undefined>, undefined>;
|
|
578
|
+
/**
|
|
579
|
+
* Present if the server offers any tools to call.
|
|
580
|
+
*/
|
|
581
|
+
readonly tools: v.OptionalSchema<v.ObjectSchema<{
|
|
582
|
+
/**
|
|
583
|
+
* Whether this server supports issuing notifications for changes to the tool list.
|
|
584
|
+
*/
|
|
585
|
+
readonly listChanged: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
586
|
+
}, undefined>, undefined>;
|
|
587
|
+
}, undefined>;
|
|
588
|
+
readonly serverInfo: v.ObjectSchema<{
|
|
589
|
+
/**
|
|
590
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
591
|
+
*
|
|
592
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
593
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
594
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
595
|
+
*
|
|
596
|
+
* Clients that support rendering icons SHOULD also support:
|
|
597
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
598
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
599
|
+
*/
|
|
600
|
+
readonly icons: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
601
|
+
/**
|
|
602
|
+
* URL or data URI for the icon.
|
|
603
|
+
*/
|
|
604
|
+
readonly src: v.StringSchema<undefined>;
|
|
605
|
+
/**
|
|
606
|
+
* Optional MIME type for the icon.
|
|
607
|
+
*/
|
|
608
|
+
readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
609
|
+
/**
|
|
610
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
611
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
612
|
+
*
|
|
613
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
614
|
+
*/
|
|
615
|
+
readonly sizes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
616
|
+
}, undefined>, undefined>, undefined>;
|
|
617
|
+
readonly version: v.StringSchema<undefined>;
|
|
618
|
+
readonly websiteUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
619
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
620
|
+
readonly name: v.StringSchema<undefined>;
|
|
621
|
+
/**
|
|
622
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
623
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
624
|
+
*
|
|
625
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
626
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
627
|
+
* if present).
|
|
628
|
+
*/
|
|
629
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
630
|
+
}, undefined>;
|
|
631
|
+
/**
|
|
632
|
+
* Instructions describing how to use the server and its features.
|
|
633
|
+
*
|
|
634
|
+
* 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.
|
|
635
|
+
*/
|
|
636
|
+
readonly instructions: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
637
|
+
/**
|
|
638
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
639
|
+
* for notes on _meta usage.
|
|
640
|
+
*/
|
|
641
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
642
|
+
}, undefined>;
|
|
493
643
|
/**
|
|
494
644
|
* A known resource that the server is capable of reading.
|
|
495
645
|
*/
|
|
@@ -553,6 +703,156 @@ declare module 'tmcp' {
|
|
|
553
703
|
*/
|
|
554
704
|
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
555
705
|
}, undefined>;
|
|
706
|
+
/**
|
|
707
|
+
* The server's response to a resources/list request from the client.
|
|
708
|
+
*/
|
|
709
|
+
const ListResourcesResultSchema: v.ObjectSchema<{
|
|
710
|
+
readonly resources: v.ArraySchema<v.ObjectSchema<{
|
|
711
|
+
/**
|
|
712
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
713
|
+
*
|
|
714
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
715
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
716
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
717
|
+
*
|
|
718
|
+
* Clients that support rendering icons SHOULD also support:
|
|
719
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
720
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
721
|
+
*/
|
|
722
|
+
readonly icons: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
723
|
+
/**
|
|
724
|
+
* URL or data URI for the icon.
|
|
725
|
+
*/
|
|
726
|
+
readonly src: v.StringSchema<undefined>;
|
|
727
|
+
/**
|
|
728
|
+
* Optional MIME type for the icon.
|
|
729
|
+
*/
|
|
730
|
+
readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
731
|
+
/**
|
|
732
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
733
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
734
|
+
*
|
|
735
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
736
|
+
*/
|
|
737
|
+
readonly sizes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
738
|
+
}, undefined>, undefined>, undefined>;
|
|
739
|
+
/**
|
|
740
|
+
* The URI of this resource.
|
|
741
|
+
*/
|
|
742
|
+
readonly uri: v.StringSchema<undefined>;
|
|
743
|
+
/**
|
|
744
|
+
* A description of what this resource represents.
|
|
745
|
+
*
|
|
746
|
+
* 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.
|
|
747
|
+
*/
|
|
748
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
749
|
+
/**
|
|
750
|
+
* The MIME type of this resource, if known.
|
|
751
|
+
*/
|
|
752
|
+
readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
753
|
+
/**
|
|
754
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
755
|
+
* for notes on _meta usage.
|
|
756
|
+
*/
|
|
757
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
758
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
759
|
+
readonly name: v.StringSchema<undefined>;
|
|
760
|
+
/**
|
|
761
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
762
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
763
|
+
*
|
|
764
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
765
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
766
|
+
* if present).
|
|
767
|
+
*/
|
|
768
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
769
|
+
}, undefined>, undefined>;
|
|
770
|
+
/**
|
|
771
|
+
* An opaque token representing the pagination position after the last returned result.
|
|
772
|
+
* If present, there may be more results available.
|
|
773
|
+
*/
|
|
774
|
+
readonly nextCursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
775
|
+
/**
|
|
776
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
777
|
+
* for notes on _meta usage.
|
|
778
|
+
*/
|
|
779
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
780
|
+
}, undefined>;
|
|
781
|
+
/**
|
|
782
|
+
* The server's response to a resources/templates/list request from the client.
|
|
783
|
+
*/
|
|
784
|
+
const ListResourceTemplatesResultSchema: v.ObjectSchema<{
|
|
785
|
+
readonly resourceTemplates: v.ArraySchema<v.ObjectSchema<{
|
|
786
|
+
/**
|
|
787
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
788
|
+
*
|
|
789
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
790
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
791
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
792
|
+
*
|
|
793
|
+
* Clients that support rendering icons SHOULD also support:
|
|
794
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
795
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
796
|
+
*/
|
|
797
|
+
readonly icons: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
798
|
+
/**
|
|
799
|
+
* URL or data URI for the icon.
|
|
800
|
+
*/
|
|
801
|
+
readonly src: v.StringSchema<undefined>;
|
|
802
|
+
/**
|
|
803
|
+
* Optional MIME type for the icon.
|
|
804
|
+
*/
|
|
805
|
+
readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
806
|
+
/**
|
|
807
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
808
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
809
|
+
*
|
|
810
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
811
|
+
*/
|
|
812
|
+
readonly sizes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
813
|
+
}, undefined>, undefined>, undefined>;
|
|
814
|
+
/**
|
|
815
|
+
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
816
|
+
*/
|
|
817
|
+
readonly uriTemplate: v.StringSchema<undefined>;
|
|
818
|
+
/**
|
|
819
|
+
* A description of what this template is for.
|
|
820
|
+
*
|
|
821
|
+
* 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.
|
|
822
|
+
*/
|
|
823
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
824
|
+
/**
|
|
825
|
+
* 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.
|
|
826
|
+
*/
|
|
827
|
+
readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
828
|
+
/**
|
|
829
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
830
|
+
* for notes on _meta usage.
|
|
831
|
+
*/
|
|
832
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
833
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
834
|
+
readonly name: v.StringSchema<undefined>;
|
|
835
|
+
/**
|
|
836
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
837
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
838
|
+
*
|
|
839
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
840
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
841
|
+
* if present).
|
|
842
|
+
*/
|
|
843
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
844
|
+
}, undefined>, undefined>;
|
|
845
|
+
/**
|
|
846
|
+
* An opaque token representing the pagination position after the last returned result.
|
|
847
|
+
* If present, there may be more results available.
|
|
848
|
+
*/
|
|
849
|
+
readonly nextCursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
850
|
+
/**
|
|
851
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
852
|
+
* for notes on _meta usage.
|
|
853
|
+
*/
|
|
854
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
855
|
+
}, undefined>;
|
|
556
856
|
/**
|
|
557
857
|
* The server's response to a resources/read request from the client.
|
|
558
858
|
*/
|
|
@@ -600,6 +900,88 @@ declare module 'tmcp' {
|
|
|
600
900
|
*/
|
|
601
901
|
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
602
902
|
}, undefined>;
|
|
903
|
+
/**
|
|
904
|
+
* The server's response to a prompts/list request from the client.
|
|
905
|
+
*/
|
|
906
|
+
const ListPromptsResultSchema: v.ObjectSchema<{
|
|
907
|
+
readonly prompts: v.ArraySchema<v.ObjectSchema<{
|
|
908
|
+
/**
|
|
909
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
910
|
+
*
|
|
911
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
912
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
913
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
914
|
+
*
|
|
915
|
+
* Clients that support rendering icons SHOULD also support:
|
|
916
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
917
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
918
|
+
*/
|
|
919
|
+
readonly icons: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
920
|
+
/**
|
|
921
|
+
* URL or data URI for the icon.
|
|
922
|
+
*/
|
|
923
|
+
readonly src: v.StringSchema<undefined>;
|
|
924
|
+
/**
|
|
925
|
+
* Optional MIME type for the icon.
|
|
926
|
+
*/
|
|
927
|
+
readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
928
|
+
/**
|
|
929
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
930
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
931
|
+
*
|
|
932
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
933
|
+
*/
|
|
934
|
+
readonly sizes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
935
|
+
}, undefined>, undefined>, undefined>;
|
|
936
|
+
/**
|
|
937
|
+
* An optional description of what this prompt provides
|
|
938
|
+
*/
|
|
939
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
940
|
+
/**
|
|
941
|
+
* A list of arguments to use for templating the prompt.
|
|
942
|
+
*/
|
|
943
|
+
readonly arguments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
944
|
+
/**
|
|
945
|
+
* The name of the argument.
|
|
946
|
+
*/
|
|
947
|
+
readonly name: v.StringSchema<undefined>;
|
|
948
|
+
/**
|
|
949
|
+
* A human-readable description of the argument.
|
|
950
|
+
*/
|
|
951
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
952
|
+
/**
|
|
953
|
+
* Whether this argument must be provided.
|
|
954
|
+
*/
|
|
955
|
+
readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
956
|
+
}, undefined>, undefined>, undefined>;
|
|
957
|
+
/**
|
|
958
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
959
|
+
* for notes on _meta usage.
|
|
960
|
+
*/
|
|
961
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
962
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
963
|
+
readonly name: v.StringSchema<undefined>;
|
|
964
|
+
/**
|
|
965
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
966
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
967
|
+
*
|
|
968
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
969
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
970
|
+
* if present).
|
|
971
|
+
*/
|
|
972
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
973
|
+
}, undefined>, undefined>;
|
|
974
|
+
/**
|
|
975
|
+
* An opaque token representing the pagination position after the last returned result.
|
|
976
|
+
* If present, there may be more results available.
|
|
977
|
+
*/
|
|
978
|
+
readonly nextCursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
979
|
+
/**
|
|
980
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
981
|
+
* for notes on _meta usage.
|
|
982
|
+
*/
|
|
983
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
984
|
+
}, undefined>;
|
|
603
985
|
/**
|
|
604
986
|
* The server's response to a prompts/get request from the client.
|
|
605
987
|
*/
|
|
@@ -812,6 +1194,130 @@ declare module 'tmcp' {
|
|
|
812
1194
|
*/
|
|
813
1195
|
readonly openWorldHint: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
814
1196
|
}, undefined>;
|
|
1197
|
+
/**
|
|
1198
|
+
* The server's response to a tools/list request from the client.
|
|
1199
|
+
*/
|
|
1200
|
+
const ListToolsResultSchema: v.ObjectSchema<{
|
|
1201
|
+
readonly tools: v.ArraySchema<v.ObjectSchema<{
|
|
1202
|
+
/**
|
|
1203
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
1204
|
+
*
|
|
1205
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
1206
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
1207
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
1208
|
+
*
|
|
1209
|
+
* Clients that support rendering icons SHOULD also support:
|
|
1210
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
1211
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
1212
|
+
*/
|
|
1213
|
+
readonly icons: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
1214
|
+
/**
|
|
1215
|
+
* URL or data URI for the icon.
|
|
1216
|
+
*/
|
|
1217
|
+
readonly src: v.StringSchema<undefined>;
|
|
1218
|
+
/**
|
|
1219
|
+
* Optional MIME type for the icon.
|
|
1220
|
+
*/
|
|
1221
|
+
readonly mimeType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1222
|
+
/**
|
|
1223
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
1224
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
1225
|
+
*
|
|
1226
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
1227
|
+
*/
|
|
1228
|
+
readonly sizes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
1229
|
+
}, undefined>, undefined>, undefined>;
|
|
1230
|
+
/**
|
|
1231
|
+
* A human-readable description of the tool.
|
|
1232
|
+
*/
|
|
1233
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1234
|
+
/**
|
|
1235
|
+
* A JSON Schema object defining the expected parameters for the tool.
|
|
1236
|
+
*/
|
|
1237
|
+
readonly inputSchema: v.ObjectSchema<{
|
|
1238
|
+
readonly type: v.LiteralSchema<"object", undefined>;
|
|
1239
|
+
readonly properties: v.OptionalSchema<v.ObjectSchema<{}, undefined>, undefined>;
|
|
1240
|
+
readonly required: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
1241
|
+
}, undefined>;
|
|
1242
|
+
/**
|
|
1243
|
+
* An optional JSON Schema object defining the structure of the tool's output returned in
|
|
1244
|
+
* the structuredContent field of a CallToolResult.
|
|
1245
|
+
*/
|
|
1246
|
+
readonly outputSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
1247
|
+
readonly type: v.LiteralSchema<"object", undefined>;
|
|
1248
|
+
readonly properties: v.OptionalSchema<v.ObjectSchema<{}, undefined>, undefined>;
|
|
1249
|
+
readonly required: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
1250
|
+
}, undefined>, undefined>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Optional additional tool information.
|
|
1253
|
+
*/
|
|
1254
|
+
readonly annotations: v.OptionalSchema<v.ObjectSchema<{
|
|
1255
|
+
/**
|
|
1256
|
+
* A human-readable title for the tool.
|
|
1257
|
+
*/
|
|
1258
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1259
|
+
/**
|
|
1260
|
+
* If true, the tool does not modify its environment.
|
|
1261
|
+
*
|
|
1262
|
+
* Default: false
|
|
1263
|
+
*/
|
|
1264
|
+
readonly readOnlyHint: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1265
|
+
/**
|
|
1266
|
+
* If true, the tool may perform destructive updates to its environment.
|
|
1267
|
+
* If false, the tool performs only additive updates.
|
|
1268
|
+
*
|
|
1269
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
1270
|
+
*
|
|
1271
|
+
* Default: true
|
|
1272
|
+
*/
|
|
1273
|
+
readonly destructiveHint: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1274
|
+
/**
|
|
1275
|
+
* If true, calling the tool repeatedly with the same arguments
|
|
1276
|
+
* will have no additional effect on the its environment.
|
|
1277
|
+
*
|
|
1278
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
1279
|
+
*
|
|
1280
|
+
* Default: false
|
|
1281
|
+
*/
|
|
1282
|
+
readonly idempotentHint: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1283
|
+
/**
|
|
1284
|
+
* If true, this tool may interact with an "open world" of external
|
|
1285
|
+
* entities. If false, the tool's domain of interaction is closed.
|
|
1286
|
+
* For example, the world of a web search tool is open, whereas that
|
|
1287
|
+
* of a memory tool is not.
|
|
1288
|
+
*
|
|
1289
|
+
* Default: true
|
|
1290
|
+
*/
|
|
1291
|
+
readonly openWorldHint: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1292
|
+
}, undefined>, undefined>;
|
|
1293
|
+
/**
|
|
1294
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
1295
|
+
* for notes on _meta usage.
|
|
1296
|
+
*/
|
|
1297
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
1298
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
1299
|
+
readonly name: v.StringSchema<undefined>;
|
|
1300
|
+
/**
|
|
1301
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
1302
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
1303
|
+
*
|
|
1304
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
1305
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
1306
|
+
* if present).
|
|
1307
|
+
*/
|
|
1308
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1309
|
+
}, undefined>, undefined>;
|
|
1310
|
+
/**
|
|
1311
|
+
* An opaque token representing the pagination position after the last returned result.
|
|
1312
|
+
* If present, there may be more results available.
|
|
1313
|
+
*/
|
|
1314
|
+
readonly nextCursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1315
|
+
/**
|
|
1316
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
1317
|
+
* for notes on _meta usage.
|
|
1318
|
+
*/
|
|
1319
|
+
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
1320
|
+
}, undefined>;
|
|
815
1321
|
/**
|
|
816
1322
|
* The server's response to a tool call.
|
|
817
1323
|
*/
|
|
@@ -1219,14 +1725,19 @@ declare module 'tmcp' {
|
|
|
1219
1725
|
}));
|
|
1220
1726
|
type ReadResourceResult_1 = v.InferInput<typeof ReadResourceResultSchema>;
|
|
1221
1727
|
type GetPromptResult_1 = v.InferInput<typeof GetPromptResultSchema>;
|
|
1222
|
-
type
|
|
1728
|
+
type CompleteResult_1 = v.InferInput<typeof CompleteResultSchema>;
|
|
1223
1729
|
type CreateMessageRequestParams_1 = v.InferInput<typeof CreateMessageRequestParamsSchema>;
|
|
1224
1730
|
type CreateMessageResult_1 = v.InferInput<typeof CreateMessageResultSchema>;
|
|
1225
1731
|
type Resource_1 = v.InferInput<typeof ResourceSchema>;
|
|
1226
|
-
type
|
|
1732
|
+
type JSONRPCMessage = v.InferInput<typeof JSONRPCMessageSchema>;
|
|
1227
1733
|
type LoggingLevel_1 = v.InferInput<typeof LoggingLevelSchema>;
|
|
1228
1734
|
type ToolAnnotations = v.InferInput<typeof ToolAnnotationsSchema>;
|
|
1229
1735
|
type ElicitResult_1 = v.InferInput<typeof ElicitResultSchema>;
|
|
1736
|
+
type InitializeResult_1 = v.InferInput<typeof InitializeResultSchema>;
|
|
1737
|
+
type ListToolsResult_1 = v.InferInput<typeof ListToolsResultSchema>;
|
|
1738
|
+
type ListPromptsResult_1 = v.InferInput<typeof ListPromptsResultSchema>;
|
|
1739
|
+
type ListResourcesResult_1 = v.InferInput<typeof ListResourcesResultSchema>;
|
|
1740
|
+
type ListResourceTemplatesResult_1 = v.InferInput<typeof ListResourceTemplatesResultSchema>;
|
|
1230
1741
|
// Helper type to remove whitespace
|
|
1231
1742
|
type Trim<S extends string> = S extends ` ${infer R}`
|
|
1232
1743
|
? Trim<R>
|
package/src/types/index.d.ts.map
CHANGED
|
@@ -15,22 +15,33 @@
|
|
|
15
15
|
"LoggingLevel",
|
|
16
16
|
"ClientInfo",
|
|
17
17
|
"ElicitResult",
|
|
18
|
+
"InitializeResult",
|
|
19
|
+
"ListToolsResult",
|
|
20
|
+
"ListPromptsResult",
|
|
21
|
+
"ListResourceTemplatesResult",
|
|
22
|
+
"ListResourcesResult",
|
|
23
|
+
"CompleteResult",
|
|
18
24
|
"Completion",
|
|
19
25
|
"ServerOptions",
|
|
20
26
|
"ChangedArgs",
|
|
21
27
|
"SubscriptionsKeysObj",
|
|
22
28
|
"SubscriptionsKeys",
|
|
23
29
|
"McpEvents",
|
|
24
|
-
"
|
|
30
|
+
"JSONRPCMessageSchema",
|
|
25
31
|
"IconsSchema",
|
|
26
32
|
"ImplementationSchema",
|
|
27
33
|
"ClientCapabilitiesSchema",
|
|
28
34
|
"InitializeRequestParamsSchema",
|
|
29
35
|
"ServerCapabilitiesSchema",
|
|
36
|
+
"InitializeResultSchema",
|
|
30
37
|
"ResourceSchema",
|
|
38
|
+
"ListResourcesResultSchema",
|
|
39
|
+
"ListResourceTemplatesResultSchema",
|
|
31
40
|
"ReadResourceResultSchema",
|
|
41
|
+
"ListPromptsResultSchema",
|
|
32
42
|
"GetPromptResultSchema",
|
|
33
43
|
"ToolAnnotationsSchema",
|
|
44
|
+
"ListToolsResultSchema",
|
|
34
45
|
"CallToolResultSchema",
|
|
35
46
|
"LoggingLevelSchema",
|
|
36
47
|
"CreateMessageRequestParamsSchema",
|
|
@@ -39,8 +50,7 @@
|
|
|
39
50
|
"CompleteResultSchema",
|
|
40
51
|
"ServerCapabilities",
|
|
41
52
|
"InitializeRequestParams",
|
|
42
|
-
"
|
|
43
|
-
"JSONRPCResponse",
|
|
53
|
+
"JSONRPCMessage",
|
|
44
54
|
"ToolAnnotations",
|
|
45
55
|
"Trim",
|
|
46
56
|
"ExtractVarName",
|
|
@@ -64,6 +74,6 @@
|
|
|
64
74
|
null,
|
|
65
75
|
null
|
|
66
76
|
],
|
|
67
|
-
"mappings": ";;;;;
|
|
77
|
+
"mappings": "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",
|
|
68
78
|
"ignoreList": []
|
|
69
79
|
}
|
package/src/validation/index.js
CHANGED
|
@@ -1571,6 +1571,9 @@ export const ServerResultSchema = v.union([
|
|
|
1571
1571
|
/**
|
|
1572
1572
|
* @typedef {v.InferInput<typeof JSONRPCRequestSchema>} JSONRPCRequest
|
|
1573
1573
|
*/
|
|
1574
|
+
/**
|
|
1575
|
+
* @typedef {v.InferInput<typeof JSONRPCMessageSchema>} JSONRPCMessage
|
|
1576
|
+
*/
|
|
1574
1577
|
/**
|
|
1575
1578
|
* @typedef {v.InferInput<typeof JSONRPCResponseSchema>} JSONRPCResponse
|
|
1576
1579
|
*/
|
|
@@ -1583,3 +1586,18 @@ export const ServerResultSchema = v.union([
|
|
|
1583
1586
|
/**
|
|
1584
1587
|
* @typedef {v.InferInput<typeof ElicitResultSchema>} ElicitResult
|
|
1585
1588
|
*/
|
|
1589
|
+
/**
|
|
1590
|
+
* @typedef {v.InferInput<typeof InitializeResultSchema>} InitializeResult
|
|
1591
|
+
*/
|
|
1592
|
+
/**
|
|
1593
|
+
* @typedef {v.InferInput<typeof ListToolsResultSchema>} ListToolsResult
|
|
1594
|
+
*/
|
|
1595
|
+
/**
|
|
1596
|
+
* @typedef {v.InferInput<typeof ListPromptsResultSchema>} ListPromptsResult
|
|
1597
|
+
*/
|
|
1598
|
+
/**
|
|
1599
|
+
* @typedef {v.InferInput<typeof ListResourcesResultSchema>} ListResourcesResult
|
|
1600
|
+
*/
|
|
1601
|
+
/**
|
|
1602
|
+
* @typedef {v.InferInput<typeof ListResourceTemplatesResultSchema>} ListResourceTemplatesResult
|
|
1603
|
+
*/
|