Class: ModelContextProtocol::Server::Tool::DefinitionDSL
- Inherits:
-
Object
- Object
- ModelContextProtocol::Server::Tool::DefinitionDSL
- Defined in:
- lib/model_context_protocol/server/tool.rb
Instance Attribute Summary collapse
-
#defined_annotations ⇒ Object
readonly
Returns the value of attribute defined_annotations.
Instance Method Summary collapse
- #annotations(&block) ⇒ Object
- #description(value = nil) ⇒ Object
- #input_schema(&block) ⇒ Object
- #name(value = nil) ⇒ Object
- #output_schema(&block) ⇒ Object
- #security_schemes(&block) ⇒ Object
- #title(value = nil) ⇒ Object
Instance Attribute Details
#defined_annotations ⇒ Object (readonly)
Returns the value of attribute defined_annotations.
160 161 162 |
# File 'lib/model_context_protocol/server/tool.rb', line 160 def defined_annotations @defined_annotations end |
Instance Method Details
#annotations(&block) ⇒ Object
162 163 164 165 166 |
# File 'lib/model_context_protocol/server/tool.rb', line 162 def annotations(&block) @defined_annotations = AnnotationsDSL.new @defined_annotations.instance_eval(&block) @defined_annotations end |
#description(value = nil) ⇒ Object
140 141 142 143 |
# File 'lib/model_context_protocol/server/tool.rb', line 140 def description(value = nil) @description = value if value @description end |
#input_schema(&block) ⇒ Object
150 151 152 153 |
# File 'lib/model_context_protocol/server/tool.rb', line 150 def input_schema(&block) @input_schema = instance_eval(&block) if block_given? @input_schema end |
#name(value = nil) ⇒ Object
135 136 137 138 |
# File 'lib/model_context_protocol/server/tool.rb', line 135 def name(value = nil) @name = value if value @name end |
#output_schema(&block) ⇒ Object
155 156 157 158 |
# File 'lib/model_context_protocol/server/tool.rb', line 155 def output_schema(&block) @output_schema = instance_eval(&block) if block_given? @output_schema end |
#security_schemes(&block) ⇒ Object
168 169 170 171 |
# File 'lib/model_context_protocol/server/tool.rb', line 168 def security_schemes(&block) @security_schemes = instance_eval(&block) if block_given? @security_schemes end |
#title(value = nil) ⇒ Object
145 146 147 148 |
# File 'lib/model_context_protocol/server/tool.rb', line 145 def title(value = nil) @title = value if value @title end |