fix: add missing size field to ResourceSchema (#1574)

Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
This commit is contained in:
Ola Hungerford 2026-03-26 09:08:59 -07:00 • committed by GitHub
commit 379392d044
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@modelcontextprotocol/core': patch
---
Add missing `size` field to `ResourceSchema` to match the MCP specification

View file

@ -832,6 +832,13 @@ export const ResourceSchema = z.object({
*/
mimeType: z.optional(z.string()),
/**
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
*
* This can be used by Hosts to display file sizes and estimate context window usage.
*/
size: z.optional(z.number()),
/**
* Optional annotations for the client.
*/