diff --git a/schema/draft/schema.json b/schema/draft/schema.json index 62bfb110d..d445fdcd7 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -112,6 +112,9 @@ "description": "A list of content objects that represent the unstructured result of the tool call.", "items": { "anyOf": [ + { + "$ref": "#/definitions/Resource" + }, { "$ref": "#/definitions/TextContent" }, @@ -1566,6 +1569,10 @@ "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window usage.", "type": "integer" }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "The status of this resource.\n\nThis can be used by clients to determine whether the resource is available for use." + }, "uri": { "description": "The URI of this resource.", "format": "uri", @@ -1639,6 +1646,16 @@ ], "type": "object" }, + "ResourceStatus": { + "description": "The status of this resource.\n\nThis can be used by clients to determine whether the resource is available for use.", + "enum": [ + "available", + "deleted", + "error", + "pending" + ], + "type": "string" + }, "ResourceTemplate": { "description": "A template description for resources available on the server.", "properties": { diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index 2f359e0d6..3b32e96a0 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -439,6 +439,17 @@ export interface ResourceUpdatedNotification extends Notification { }; } +/** + * The status of this resource. + * + * This can be used by clients to determine whether the resource is available for use. + */ +export type ResourceStatus = + | "pending" + | "available" + | "error" + | "deleted" + /** * A known resource that the server is capable of reading. */ @@ -464,6 +475,13 @@ export interface Resource { */ description?: string; + /** + * The status of this resource. + * + * This can be used by clients to determine whether the resource is available for use. + */ + status?: ResourceStatus; + /** * The MIME type of this resource, if known. */ @@ -690,7 +708,7 @@ export interface CallToolResult extends Result { /** * A list of content objects that represent the unstructured result of the tool call. */ - content: (TextContent | ImageContent | AudioContent | EmbeddedResource)[]; + content: (TextContent | ImageContent | AudioContent | EmbeddedResource | Resource)[]; /** * An optional JSON object that represents the structured result of the tool call.