Skip to content

Commit cf82e7d

Browse files
committed
add IconsSchema to ResourceTemplates as per modelcontextprotocol/modelcontextprotocol#1565
1 parent 810dda0 commit cf82e7d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/types.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,15 @@ export const IconSchema = z
224224
.passthrough();
225225

226226
/**
227-
* An optional list of icons for this implementation.
228-
* This can be used by clients to display the implementation in a user interface.
229-
* Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
230-
* The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
231-
* The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
232-
* The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
227+
* Optional set of sized icons that the client can display in a user interface.
228+
*
229+
* Clients that support rendering icons MUST support at least the following MIME types:
230+
* - `image/png` - PNG images (safe, universal compatibility)
231+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
232+
*
233+
* Clients that support rendering icons SHOULD also support:
234+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
235+
* - `image/webp` - WebP images (modern, efficient format)
233236
*/
234237
export const IconsSchema = z.object({
235238
icons: z.array(IconSchema).optional(),
@@ -578,7 +581,7 @@ export const ResourceTemplateSchema = BaseMetadataSchema.extend({
578581
* for notes on _meta usage.
579582
*/
580583
_meta: z.optional(z.object({}).passthrough()),
581-
});
584+
}).merge(IconsSchema);
582585

583586
/**
584587
* Sent from the client to request a list of resources the server has.

0 commit comments

Comments
 (0)