@@ -806,6 +806,17 @@ public record JsonSchema( // @formatter:off
806806 @ JsonProperty ("definitions" ) Map <String , Object > definitions ) {
807807 } // @formatter:on
808808
809+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
810+ @ JsonIgnoreProperties (ignoreUnknown = true )
811+ public record ToolAnnotations ( // @formatter:off
812+ @ JsonProperty ("title" ) String title ,
813+ @ JsonProperty ("readOnlyHint" ) Boolean readOnlyHint ,
814+ @ JsonProperty ("destructiveHint" ) Boolean destructiveHint ,
815+ @ JsonProperty ("idempotentHint" ) Boolean idempotentHint ,
816+ @ JsonProperty ("openWorldHint" ) Boolean openWorldHint ,
817+ @ JsonProperty ("returnDirect" ) Boolean returnDirect ) {
818+ } // @formatter:on
819+
809820 /**
810821 * Represents a tool that the server provides. Tools enable servers to expose
811822 * executable functionality to the system. Through these tools, you can interact with
@@ -817,17 +828,23 @@ public record JsonSchema( // @formatter:off
817828 * used by clients to improve the LLM's understanding of available tools.
818829 * @param inputSchema A JSON Schema object that describes the expected structure of
819830 * the arguments when calling this tool. This allows clients to validate tool
820- * arguments before sending them to the server.
831+ * @param annotations Additional properties describing a Tool to clients. arguments
832+ * before sending them to the server.
821833 */
822834 @ JsonInclude (JsonInclude .Include .NON_ABSENT )
823835 @ JsonIgnoreProperties (ignoreUnknown = true )
824836 public record Tool ( // @formatter:off
825- @ JsonProperty ("name" ) String name ,
826- @ JsonProperty ("description" ) String description ,
827- @ JsonProperty ("inputSchema" ) JsonSchema inputSchema ) {
837+ @ JsonProperty ("name" ) String name ,
838+ @ JsonProperty ("description" ) String description ,
839+ @ JsonProperty ("inputSchema" ) JsonSchema inputSchema ,
840+ @ JsonProperty ("annotations" ) ToolAnnotations annotations ) {
828841
829842 public Tool (String name , String description , String schema ) {
830- this (name , description , parseSchema (schema ));
843+ this (name , description , parseSchema (schema ), null );
844+ }
845+
846+ public Tool (String name , String description , String schema , ToolAnnotations annotations ) {
847+ this (name , description , parseSchema (schema ), annotations );
831848 }
832849
833850 } // @formatter:on
0 commit comments