Skip to content

Commit c17ee30

Browse files
committed
rebase on modelcontextprotocol#208, split out DisplayAnnotations
1 parent bf513ca commit c17ee30

File tree

2 files changed

+80
-16
lines changed

2 files changed

+80
-16
lines changed

schema/draft/schema.json

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,35 @@
464464
"description": "An opaque token used to represent a cursor for pagination.",
465465
"type": "string"
466466
},
467+
"DisplayAnnotations": {
468+
"description": "Annotations that provide display-facing information to the client.",
469+
"properties": {
470+
"icon": {
471+
"properties": {
472+
"contentType": {
473+
"type": "string"
474+
},
475+
"data": {
476+
"type": "string"
477+
}
478+
},
479+
"required": [
480+
"contentType",
481+
"data"
482+
],
483+
"type": "object"
484+
},
485+
"icon_url": {
486+
"description": "A URL from which a client can fetch an icon to represent this object.",
487+
"type": "string"
488+
},
489+
"title": {
490+
"description": "A human-readable title for the object or data.",
491+
"type": "string"
492+
}
493+
},
494+
"type": "object"
495+
},
467496
"EmbeddedResource": {
468497
"description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
469498
"properties": {
@@ -1985,10 +2014,25 @@
19852014
"type": "object"
19862015
},
19872016
"ToolAnnotations": {
1988-
"description": "Optional, supplemental properties that characterize a tool's behavior.",
2017+
"description": "Annotations that provide display-facing and operational information for a Tool.",
19892018
"properties": {
1990-
"caption": {
1991-
"description": "A succinct user-facing description of the tool.\n\nUnlike Tool.description, this is not intended for use as a \"hint\" to the model.",
2019+
"icon": {
2020+
"properties": {
2021+
"contentType": {
2022+
"type": "string"
2023+
},
2024+
"data": {
2025+
"type": "string"
2026+
}
2027+
},
2028+
"required": [
2029+
"contentType",
2030+
"data"
2031+
],
2032+
"type": "object"
2033+
},
2034+
"icon_url": {
2035+
"description": "A URL from which a client can fetch an icon to represent this object.",
19922036
"type": "string"
19932037
},
19942038
"openWorld": {
@@ -1998,6 +2042,10 @@
19982042
"readOnly": {
19992043
"description": "If true, this tool does not perform writes or updates,\nor otherwise change server-side state in ways that would\nbe visible in subsequent tool calls.\n\nIf not set, this is assumed to be false.",
20002044
"type": "boolean"
2045+
},
2046+
"title": {
2047+
"description": "A human-readable title for the object or data.",
2048+
"type": "string"
20012049
}
20022050
},
20032051
"type": "object"

schema/draft/schema.ts

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,29 @@ export interface ToolListChangedNotification extends Notification {
697697
}
698698

699699
/**
700-
* Optional, supplemental properties that characterize a tool's behavior.
700+
* Annotations that provide display-facing information to the client.
701701
*/
702-
export interface ToolAnnotations {
702+
export interface DisplayAnnotations {
703+
/**
704+
* A human-readable title for the object or data.
705+
*/
706+
title?: string;
707+
708+
icon?: {
709+
data: string; // base64-encoded image data
710+
contentType: string; // MIME type of the image
711+
};
712+
713+
/**
714+
* A URL from which a client can fetch an icon to represent this object.
715+
*/
716+
icon_url?: string;
717+
}
718+
719+
/**
720+
* Annotations that provide display-facing and operational information for a Tool.
721+
*/
722+
export interface ToolAnnotations extends DisplayAnnotations {
703723
/**
704724
* If true, this tool does not perform writes or updates,
705725
* or otherwise change server-side state in ways that would
@@ -716,13 +736,6 @@ export interface ToolAnnotations {
716736
* If not set, this is assumed to be true.
717737
*/
718738
openWorld?: boolean;
719-
720-
/**
721-
* A succinct user-facing description of the tool.
722-
*
723-
* Unlike Tool.description, this is not intended for use as a "hint" to the model.
724-
*/
725-
caption?: string;
726739
}
727740

728741
/**
@@ -733,16 +746,14 @@ export interface Tool {
733746
* The name of the tool.
734747
*/
735748
name: string;
749+
736750
/**
737751
* A human-readable description of the tool.
738752
*
739753
* This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.
740754
*/
741755
description?: string;
742-
/**
743-
* Annotations
744-
*/
745-
annotations?: ToolAnnotations;
756+
746757
/**
747758
* A JSON Schema object defining the expected parameters for the tool.
748759
*/
@@ -751,6 +762,11 @@ export interface Tool {
751762
properties?: { [key: string]: object };
752763
required?: string[];
753764
};
765+
766+
/**
767+
* Annotations
768+
*/
769+
annotations?: ToolAnnotations;
754770
}
755771

756772
/* Logging */

0 commit comments

Comments
 (0)