diff --git a/docs/specification/server/resources.md b/docs/specification/server/resources.md index b2212f3..9eddcb3 100644 --- a/docs/specification/server/resources.md +++ b/docs/specification/server/resources.md @@ -246,6 +246,7 @@ A resource definition includes: - `name`: Human-readable name - `description`: Optional description - `mimeType`: Optional MIME type +- `size`: Optional size in bytes ### Resource Contents diff --git a/schema/schema.json b/schema/schema.json index e8b8c78..d360f7b 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1505,6 +1505,10 @@ "description": "A human-readable name for this resource.\n\nThis can be used by clients to populate UI elements.", "type": "string" }, + "size": { + "description": "The size of the resource in bytes before encoding or tokenization, if known.\n\nThis can be used by Hosts to display file sizes and estimate context window usage.", + "type": "integer" + }, "uri": { "description": "The URI of this resource.", "format": "uri", diff --git a/schema/schema.ts b/schema/schema.ts index eddca23..589fb53 100644 --- a/schema/schema.ts +++ b/schema/schema.ts @@ -443,6 +443,13 @@ export interface Resource extends Annotated { * The MIME type of this resource, if known. */ mimeType?: 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?: number; } /**