You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add Annotations schema and type export - Add annotations field to TextContent, ImageContent, AudioContent schemas - Add annotations field to Resource and ResourceTemplate schemas - Add size field to Resource schema - Add annotations field to EmbeddedResource schema - Add ModelHint schema and type export - Update ModelPreferences schema to include hints array and detailed documentation - Uncomment spec type tests These changes align types.ts with the latest spec definitions to ensure full compatibility. Co-Authored-By: Claude <noreply@anthropic.com>
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
530
+
*
531
+
* This can be used by Hosts to display file sizes and estimate context window usage.
532
+
*/
533
+
size: z.optional(z.number()),
534
+
489
535
/**
490
536
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
519
570
* for notes on _meta usage.
@@ -701,6 +752,11 @@ export const TextContentSchema = z
701
752
*/
702
753
text: z.string(),
703
754
755
+
/**
756
+
* Optional annotations for the client.
757
+
*/
758
+
annotations: z.optional(AnnotationsSchema),
759
+
704
760
/**
705
761
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
706
762
* for notes on _meta usage.
@@ -724,6 +780,11 @@ export const ImageContentSchema = z
724
780
*/
725
781
mimeType: z.string(),
726
782
783
+
/**
784
+
* Optional annotations for the client.
785
+
*/
786
+
annotations: z.optional(AnnotationsSchema),
787
+
727
788
/**
728
789
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
729
790
* for notes on _meta usage.
@@ -747,6 +808,11 @@ export const AudioContentSchema = z
747
808
*/
748
809
mimeType: z.string(),
749
810
811
+
/**
812
+
* Optional annotations for the client.
813
+
*/
814
+
annotations: z.optional(AnnotationsSchema),
815
+
750
816
/**
751
817
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
752
818
* for notes on _meta usage.
@@ -762,6 +828,10 @@ export const EmbeddedResourceSchema = z
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* Keys not declared here are currently left unspecified by the spec and are up
1121
+
* to the client to interpret.
1049
1122
*/
1050
1123
exportconstModelHintSchema=z
1051
1124
.object({
1052
1125
/**
1053
1126
* A hint for a model name.
1127
+
*
1128
+
* The client SHOULD treat this as a substring of a model name; for example:
1129
+
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
1130
+
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
1131
+
* - `claude` should match any Claude model
1132
+
*
1133
+
* 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:
1134
+
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
1054
1135
*/
1055
1136
name: z.string().optional(),
1056
1137
})
1057
1138
.passthrough();
1058
1139
1059
1140
/**
1060
1141
* The server's preferences for model selection, requested of the client during sampling.
1142
+
*
1143
+
* Because LLMs can vary along multiple dimensions, choosing the "best" model is
1144
+
* rarely straightforward. Different models excel in different areas—some are
1145
+
* faster but less capable, others are more capable but more expensive, and so
1146
+
* on. This interface allows servers to express their priorities across multiple
1147
+
* dimensions to help clients make an appropriate selection for their use case.
1148
+
*
1149
+
* These preferences are always advisory. The client MAY ignore them. It is also
1150
+
* up to the client to decide how to interpret these preferences and how to
1151
+
* balance them against other considerations.
1061
1152
*/
1062
1153
exportconstModelPreferencesSchema=z
1063
1154
.object({
1064
1155
/**
1065
1156
* Optional hints to use for model selection.
1157
+
*
1158
+
* If multiple hints are specified, the client MUST evaluate them in order
1159
+
* (such that the first match is taken).
1160
+
*
1161
+
* The client SHOULD prioritize these hints over the numeric priorities, but
1162
+
* MAY still use the priorities to select from ambiguous matches.
1066
1163
*/
1067
1164
hints: z.optional(z.array(ModelHintSchema)),
1068
1165
/**
@@ -1569,6 +1666,9 @@ export type PromptMessage = Infer<typeof PromptMessageSchema>;
0 commit comments