@@ -29,7 +29,7 @@ const BaseRequestParamsSchema = z
29
29
*/
30
30
progressToken : z . optional ( ProgressTokenSchema ) ,
31
31
} )
32
- . passthrough ( )
32
+ . passthrough ( ) ,
33
33
) ,
34
34
} )
35
35
. passthrough ( ) ;
@@ -100,16 +100,16 @@ export const JSONRPCResponseSchema = z
100
100
. strict ( ) ;
101
101
102
102
/**
103
- * @author : Sumitesh Naithani
104
- * @link : https://docs.trafficserver.apache.org/en/latest/developer-guide/jsonrpc/jsonrpc-node-errors.en.html#standard-errors
105
- * @description : An incomplete set of error codes that may appear in JSON-RPC responses.
106
- * @note : SDK-specific errors should use the server error range (-32000 to -32099), as per JSON-RPC 2.0 specification.
107
- */
103
+ * @author : Sumitesh Naithani
104
+ * @link : https://docs.trafficserver.apache.org/en/latest/developer-guide/jsonrpc/jsonrpc-node-errors.en.html#standard-errors
105
+ * @description : An incomplete set of error codes that may appear in JSON-RPC responses.
106
+ * @note : SDK-specific errors should use the server error range (-32000 to -32099), as per JSON-RPC 2.0 specification.
107
+ */
108
108
export enum ErrorCode {
109
109
// SDK error codes (using server error range)
110
110
ConnectionClosed = - 32000 ,
111
111
RequestTimeout = - 32001 ,
112
-
112
+
113
113
// Standard JSON-RPC error codes
114
114
ParseError = - 32700 ,
115
115
InvalidRequest = - 32600 ,
@@ -217,7 +217,7 @@ export const ClientCapabilitiesSchema = z
217
217
*/
218
218
listChanged : z . optional ( z . boolean ( ) ) ,
219
219
} )
220
- . passthrough ( )
220
+ . passthrough ( ) ,
221
221
) ,
222
222
} )
223
223
. passthrough ( ) ;
@@ -261,7 +261,7 @@ export const ServerCapabilitiesSchema = z
261
261
*/
262
262
listChanged : z . optional ( z . boolean ( ) ) ,
263
263
} )
264
- . passthrough ( )
264
+ . passthrough ( ) ,
265
265
) ,
266
266
/**
267
267
* Present if the server offers any resources to read.
@@ -279,7 +279,7 @@ export const ServerCapabilitiesSchema = z
279
279
*/
280
280
listChanged : z . optional ( z . boolean ( ) ) ,
281
281
} )
282
- . passthrough ( )
282
+ . passthrough ( ) ,
283
283
) ,
284
284
/**
285
285
* Present if the server offers any tools to call.
@@ -292,7 +292,7 @@ export const ServerCapabilitiesSchema = z
292
292
*/
293
293
listChanged : z . optional ( z . boolean ( ) ) ,
294
294
} )
295
- . passthrough ( )
295
+ . passthrough ( ) ,
296
296
) ,
297
297
} )
298
298
. passthrough ( ) ;
@@ -483,7 +483,7 @@ export const ListResourcesResultSchema = PaginatedResultSchema.extend({
483
483
export const ListResourceTemplatesRequestSchema = PaginatedRequestSchema . extend (
484
484
{
485
485
method : z . literal ( "resources/templates/list" ) ,
486
- }
486
+ } ,
487
487
) ;
488
488
489
489
/**
@@ -511,7 +511,7 @@ export const ReadResourceRequestSchema = RequestSchema.extend({
511
511
*/
512
512
export const ReadResourceResultSchema = ResultSchema . extend ( {
513
513
contents : z . array (
514
- z . union ( [ TextResourceContentsSchema , BlobResourceContentsSchema ] )
514
+ z . union ( [ TextResourceContentsSchema , BlobResourceContentsSchema ] ) ,
515
515
) ,
516
516
} ) ;
517
517
@@ -750,7 +750,7 @@ export const ListToolsResultSchema = PaginatedResultSchema.extend({
750
750
*/
751
751
export const CallToolResultSchema = ResultSchema . extend ( {
752
752
content : z . array (
753
- z . union ( [ TextContentSchema , ImageContentSchema , EmbeddedResourceSchema ] )
753
+ z . union ( [ TextContentSchema , ImageContentSchema , EmbeddedResourceSchema ] ) ,
754
754
) ,
755
755
isError : z . boolean ( ) . default ( false ) . optional ( ) ,
756
756
} ) ;
@@ -761,7 +761,7 @@ export const CallToolResultSchema = ResultSchema.extend({
761
761
export const CompatibilityCallToolResultSchema = CallToolResultSchema . or (
762
762
ResultSchema . extend ( {
763
763
toolResult : z . unknown ( ) ,
764
- } )
764
+ } ) ,
765
765
) ;
766
766
767
767
/**
@@ -922,7 +922,7 @@ export const CreateMessageResultSchema = ResultSchema.extend({
922
922
* The reason why sampling stopped.
923
923
*/
924
924
stopReason : z . optional (
925
- z . enum ( [ "endTurn" , "stopSequence" , "maxTokens" ] ) . or ( z . string ( ) )
925
+ z . enum ( [ "endTurn" , "stopSequence" , "maxTokens" ] ) . or ( z . string ( ) ) ,
926
926
) ,
927
927
role : z . enum ( [ "user" , "assistant" ] ) ,
928
928
content : z . discriminatedUnion ( "type" , [
@@ -1107,7 +1107,7 @@ export class McpError extends Error {
1107
1107
constructor (
1108
1108
public readonly code : number ,
1109
1109
message : string ,
1110
- public readonly data ?: unknown
1110
+ public readonly data ?: unknown ,
1111
1111
) {
1112
1112
super ( `MCP error ${ code } : ${ message } ` ) ;
1113
1113
}
@@ -1240,4 +1240,4 @@ export type ClientResult = z.infer<typeof ClientResultSchema>;
1240
1240
/* Server messages */
1241
1241
export type ServerRequest = z . infer < typeof ServerRequestSchema > ;
1242
1242
export type ServerNotification = z . infer < typeof ServerNotificationSchema > ;
1243
- export type ServerResult = z . infer < typeof ServerResultSchema > ;
1243
+ export type ServerResult = z . infer < typeof ServerResultSchema > ;
0 commit comments