diff --git a/schema/draft/schema.json b/schema/draft/schema.json index 1f91ad4..51067c0 100644 --- a/schema/draft/schema.json +++ b/schema/draft/schema.json @@ -67,6 +67,203 @@ ], "type": "object" }, + "AugmentRequest": { + "description": "Request to augment context with additional information.", + "properties": { + "method": { + "const": "augmentation/augment", + "type": "string" + }, + "params": { + "properties": { + "arguments": { + "additionalProperties": {}, + "description": "Additional parameters for the augmentation.\nmaxResult and minRelevance are common parameters for augmentations that return multiple results, but the exact parameters are server-specific.", + "properties": { + "maxResults": { + "type": "integer" + }, + "minRelevance": { + "type": "integer" + } + }, + "type": "object" + }, + "context": { + "description": "The context to augment. This can include text, images, or other resources.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/TextContent" + }, + { + "$ref": "#/definitions/ImageContent" + }, + { + "$ref": "#/definitions/AudioContent" + }, + { + "$ref": "#/definitions/EmbeddedResource" + } + ] + }, + "type": "array" + }, + "name": { + "description": "The name of the augmentation to perform.", + "type": "string" + } + }, + "required": [ + "context", + "name" + ], + "type": "object" + } + }, + "required": [ + "method", + "params" + ], + "type": "object" + }, + "AugmentResult": { + "description": "Response containing augmented context.", + "properties": { + "_meta": { + "additionalProperties": {}, + "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", + "type": "object" + }, + "content": { + "description": "The augmented content. Each item in the array represents a single augmented result.\nIt is server-specific how to interpret the content.", + "items": { + "$ref": "#/definitions/AugmentedContent" + }, + "type": "array" + }, + "hint": { + "description": "Hints for the client on how to interpret the augmented content.", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "description": "Optional metadata for the entire augmented result.", + "properties": {}, + "type": "object" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "Augmentation": { + "description": "Describes an augmentation capability offered by the server.", + "properties": { + "description": { + "description": "A human-readable description of the augmentation.", + "type": "string" + }, + "inputSchema": { + "description": "A JSON Schema object defining the expected additional parameters for the augmentation.", + "properties": { + "properties": { + "additionalProperties": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "type": "object" + }, + "required": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "const": "object", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "name": { + "description": "The name of the augmentation.", + "type": "string" + } + }, + "required": [ + "inputSchema", + "name" + ], + "type": "object" + }, + "AugmentationListChangedNotification": { + "description": "An optional notification from the server to the client, informing that the list\nof augmentations it offers has changed. This may be issued by servers without\nany previous subscription.", + "properties": { + "method": { + "const": "notifications/augmentation/list_changed", + "type": "string" + }, + "params": { + "additionalProperties": {}, + "properties": { + "_meta": { + "additionalProperties": {}, + "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "method" + ], + "type": "object" + }, + "AugmentedContent": { + "description": "A single piece of content returned from augmentation with its properties.", + "properties": { + "content": { + "anyOf": [ + { + "$ref": "#/definitions/TextContent" + }, + { + "$ref": "#/definitions/ImageContent" + }, + { + "$ref": "#/definitions/AudioContent" + }, + { + "$ref": "#/definitions/EmbeddedResource" + } + ], + "description": "The content part of the individual augmented result content." + }, + "properties": { + "additionalProperties": {}, + "description": "The properties of the individual augmented result content.", + "properties": { + "relevance": { + "description": "Relevance of the content, as often used in RAG systems.", + "type": "integer" + } + }, + "type": "object" + } + }, + "required": [ + "content" + ], + "type": "object" + }, "BlobResourceContents": { "properties": { "blob": { @@ -870,6 +1067,52 @@ ], "type": "object" }, + "ListAugmentationsRequest": { + "description": "Sent from the client to request a list of augmentations the server has.", + "properties": { + "method": { + "const": "augmentation/list", + "type": "string" + }, + "params": { + "properties": { + "cursor": { + "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "method" + ], + "type": "object" + }, + "ListAugmentationsResult": { + "description": "The server's response to an augmentation/list request from the client.", + "properties": { + "_meta": { + "additionalProperties": {}, + "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", + "type": "object" + }, + "augmentations": { + "items": { + "$ref": "#/definitions/Augmentation" + }, + "type": "array" + }, + "nextCursor": { + "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", + "type": "string" + } + }, + "required": [ + "augmentations" + ], + "type": "object" + }, "ListPromptsRequest": { "description": "Sent from the client to request a list of prompts and prompt templates the server has.", "properties": { @@ -1788,6 +2031,16 @@ "ServerCapabilities": { "description": "Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.", "properties": { + "augmentation": { + "description": "Present if the server offers any augmentation capabilities.", + "properties": { + "listChanged": { + "description": "Whether this server supports notifications for changes to the augmentation list.", + "type": "boolean" + } + }, + "type": "object" + }, "experimental": { "additionalProperties": { "additionalProperties": true, diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts index 0207049..0a679d1 100644 --- a/schema/draft/schema.ts +++ b/schema/draft/schema.ts @@ -247,6 +247,15 @@ export interface ServerCapabilities { * Whether this server supports notifications for changes to the tool list. */ listChanged?: boolean; + }; + /** + * Present if the server offers any augmentation capabilities. + */ + augmentation?: { + /** + * Whether this server supports notifications for changes to the augmentation list. + */ + listChanged?: boolean; }; } @@ -699,6 +708,120 @@ export interface Tool { }; } + +/** + * Sent from the client to request a list of augmentations the server has. + */ +export interface ListAugmentationsRequest extends PaginatedRequest { + method: "augmentation/list"; +} + +/** +* The server's response to an augmentation/list request from the client. +*/ +export interface ListAugmentationsResult extends PaginatedResult { + augmentations: Augmentation[]; +} + +/** +* An optional notification from the server to the client, informing that the list +* of augmentations it offers has changed. This may be issued by servers without +* any previous subscription. +*/ +export interface AugmentationListChangedNotification extends Notification { + method: "notifications/augmentation/list_changed"; +} + +/** + * Request to augment context with additional information. + */ +export interface AugmentRequest { + method: "augmentation/augment"; + params: { + /** + * The name of the augmentation to perform. + */ + name: string; + /** + * The context to augment. This can include text, images, or other resources. + */ + context: (TextContent | ImageContent | AudioContent | EmbeddedResource)[]; + /** + * Additional parameters for the augmentation. + * maxResult and minRelevance are common parameters for augmentations that return multiple results, but the exact parameters are server-specific. + */ + arguments?: { + maxResults?: number; + minRelevance?: number; + [key: string]: unknown; + }; + }; +} + +/** + * A single piece of content returned from augmentation with its properties. + */ +export interface AugmentedContent { + /** + * The content part of the individual augmented result content. + */ + content: TextContent | ImageContent | AudioContent | EmbeddedResource; + /** + * The properties of the individual augmented result content. + */ + properties?: { + /** + * Relevance of the content, as often used in RAG systems. + */ + relevance?: number; + /** + * Optional additional properties. + */ + [key: string]: unknown; + }; +} + +/** +* Response containing augmented context. +*/ +export interface AugmentResult extends Result { + /** + * The augmented content. Each item in the array represents a single augmented result. + * It is server-specific how to interpret the content. + */ + content: AugmentedContent[]; + /** + * Hints for the client on how to interpret the augmented content. + */ + hint?: string; + /** + * Optional metadata for the entire augmented result. + */ + metadata?: object; +} + +/** + * Describes an augmentation capability offered by the server. + */ +export interface Augmentation { + /** + * The name of the augmentation. + */ + name: string; + /** + * A human-readable description of the augmentation. + */ + description?: string; + /** + * A JSON Schema object defining the expected additional parameters for the augmentation. + */ + inputSchema: { + type: "object"; + properties?: { [key: string]: object }; + required?: string[]; + }; +} + /* Logging */ /** * A request from the client to the server, to enable or adjust logging.