@@ -208,18 +208,49 @@ func WithDescription(description string) ToolOption {
208208}
209209
210210// WithToolAnnotation adds optional hints about the Tool.
211- func WithToolAnnotation (
212- title string ,
213- readOnlyHint , destructiveHint , idempotentHint , openWorldHint bool ,
214- ) ToolOption {
211+ func WithToolAnnotation (annotation ToolAnnotation ) ToolOption {
215212 return func (t * Tool ) {
216- t .Annotations = ToolAnnotation {
217- Title : title ,
218- ReadOnlyHint : & readOnlyHint ,
219- DestructiveHint : & destructiveHint ,
220- IdempotentHint : & idempotentHint ,
221- OpenWorldHint : & openWorldHint ,
222- }
213+ t .Annotations = annotation
214+ }
215+ }
216+
217+ // WithTitleAnnotation sets the Title field of the Tool's Annotations.
218+ // It provides a human-readable title for the tool.
219+ func WithTitleAnnotation (title string ) ToolOption {
220+ return func (t * Tool ) {
221+ t .Annotations .Title = title
222+ }
223+ }
224+
225+ // WithReadOnlyHintAnnotation sets the ReadOnlyHint field of the Tool's Annotations.
226+ // If true, it indicates the tool does not modify its environment.
227+ func WithReadOnlyHintAnnotation (value bool ) ToolOption {
228+ return func (t * Tool ) {
229+ t .Annotations .ReadOnlyHint = & value
230+ }
231+ }
232+
233+ // WithDestructiveHintAnnotation sets the DestructiveHint field of the Tool's Annotations.
234+ // If true, it indicates the tool may perform destructive updates.
235+ func WithDestructiveHintAnnotation (value bool ) ToolOption {
236+ return func (t * Tool ) {
237+ t .Annotations .DestructiveHint = & value
238+ }
239+ }
240+
241+ // WithIdempotentHintAnnotation sets the IdempotentHint field of the Tool's Annotations.
242+ // If true, it indicates repeated calls with the same arguments have no additional effect.
243+ func WithIdempotentHintAnnotation (value bool ) ToolOption {
244+ return func (t * Tool ) {
245+ t .Annotations .IdempotentHint = & value
246+ }
247+ }
248+
249+ // WithOpenWorldHintAnnotation sets the OpenWorldHint field of the Tool's Annotations.
250+ // If true, it indicates the tool interacts with external entities.
251+ func WithOpenWorldHintAnnotation (value bool ) ToolOption {
252+ return func (t * Tool ) {
253+ t .Annotations .OpenWorldHint = & value
223254 }
224255}
225256
0 commit comments