[v1.x] fix: add missing size field to ResourceSchema (#1575)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
This commit is contained in:
parent
2a15851302
commit
ddadaa6cc6
2 changed files with 12 additions and 0 deletions
5
.changeset/add-resource-size-field.md
Normal file
5
.changeset/add-resource-size-field.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@modelcontextprotocol/sdk': patch
|
||||
---
|
||||
|
||||
Add missing `size` field to `ResourceSchema` to match the MCP specification
|
||||
|
|
@ -900,6 +900,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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue