Class: ModelContextProtocol::Server::Tool::AnnotationsDSL
- Inherits:
-
Object
- Object
- ModelContextProtocol::Server::Tool::AnnotationsDSL
- Defined in:
- lib/model_context_protocol/server/tool.rb
Instance Method Summary collapse
- #destructive_hint(value) ⇒ Object
- #idempotent_hint(value) ⇒ Object
-
#initialize ⇒ AnnotationsDSL
constructor
A new instance of AnnotationsDSL.
- #open_world_hint(value) ⇒ Object
- #read_only_hint(value) ⇒ Object
- #serialized ⇒ Object
Constructor Details
#initialize ⇒ AnnotationsDSL
Returns a new instance of AnnotationsDSL.
175 176 177 178 179 180 |
# File 'lib/model_context_protocol/server/tool.rb', line 175 def initialize @read_only_hint = nil @destructive_hint = nil @idempotent_hint = nil @open_world_hint = nil end |
Instance Method Details
#destructive_hint(value) ⇒ Object
187 188 189 190 |
# File 'lib/model_context_protocol/server/tool.rb', line 187 def destructive_hint(value) validate_boolean!(:destructive_hint, value) @destructive_hint = value end |
#idempotent_hint(value) ⇒ Object
192 193 194 195 |
# File 'lib/model_context_protocol/server/tool.rb', line 192 def idempotent_hint(value) validate_boolean!(:idempotent_hint, value) @idempotent_hint = value end |
#open_world_hint(value) ⇒ Object
197 198 199 200 |
# File 'lib/model_context_protocol/server/tool.rb', line 197 def open_world_hint(value) validate_boolean!(:open_world_hint, value) @open_world_hint = value end |
#read_only_hint(value) ⇒ Object
182 183 184 185 |
# File 'lib/model_context_protocol/server/tool.rb', line 182 def read_only_hint(value) validate_boolean!(:read_only_hint, value) @read_only_hint = value end |
#serialized ⇒ Object
202 203 204 205 206 207 208 209 |
# File 'lib/model_context_protocol/server/tool.rb', line 202 def serialized result = {} result[:readOnlyHint] = @read_only_hint unless @read_only_hint.nil? result[:destructiveHint] = @destructive_hint unless @destructive_hint.nil? result[:idempotentHint] = @idempotent_hint unless @idempotent_hint.nil? result[:openWorldHint] = @open_world_hint unless @open_world_hint.nil? result.empty? ? nil : result end |