@@ -5,6 +5,7 @@ class Tool
55 class << self
66 NOT_SET = Object . new
77
8+ attr_reader :title_value
89 attr_reader :description_value
910 attr_reader :annotations_value
1011
@@ -15,6 +16,7 @@ def call(*args, server_context: nil)
1516 def to_h
1617 result = {
1718 name : name_value ,
19+ title : title_value ,
1820 description : description_value ,
1921 inputSchema : input_schema_value . to_h ,
2022 }
@@ -25,6 +27,7 @@ def to_h
2527 def inherited ( subclass )
2628 super
2729 subclass . instance_variable_set ( :@name_value , nil )
30+ subclass . instance_variable_set ( :@title_value , nil )
2831 subclass . instance_variable_set ( :@description_value , nil )
2932 subclass . instance_variable_set ( :@input_schema_value , nil )
3033 subclass . instance_variable_set ( :@annotations_value , nil )
@@ -46,6 +49,14 @@ def input_schema_value
4649 @input_schema_value || InputSchema . new
4750 end
4851
52+ def title ( value = NOT_SET )
53+ if value == NOT_SET
54+ @title_value
55+ else
56+ @title_value = value
57+ end
58+ end
59+
4960 def description ( value = NOT_SET )
5061 if value == NOT_SET
5162 @description_value
@@ -74,9 +85,10 @@ def annotations(hash = NOT_SET)
7485 end
7586 end
7687
77- def define ( name : nil , description : nil , input_schema : nil , annotations : nil , &block )
88+ def define ( name : nil , title : nil , description : nil , input_schema : nil , annotations : nil , &block )
7889 Class . new ( self ) do
7990 tool_name name
91+ title title
8092 description description
8193 input_schema input_schema
8294 self . annotations ( annotations ) if annotations
0 commit comments