Skip to content

Commit 8ede7c9

Browse files
committed
Adjusting source code comments as as requested in review
1 parent 5944942 commit 8ede7c9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/mcp/tool/input_schema.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ def validate_schema!
5151
accept_uri: false,
5252
accept_file: ->(path) { path.to_s.start_with?(Gem.loaded_specs["json-schema"].full_gem_path) },
5353
)
54-
# Get the metaschema for the draft4 validator
5554
metaschema_path = Pathname.new(JSON::Validator.validator_for_name("draft4").metaschema)
56-
# Converts metaschema to a file URI for Windows compatibility
55+
# Converts metaschema to a file URI for cross-platform compatibility
5756
metaschema_uri = JSON::Util::URI.file_uri(metaschema_path.expand_path.cleanpath.to_s.tr("\\", "/"))
5857
metaschema = metaschema_uri.to_s
59-
# Validates the input returning any errors
6058
errors = JSON::Validator.fully_validate(metaschema, schema, schema_reader: schema_reader)
6159
if errors.any?
6260
raise ArgumentError, "Invalid JSON Schema: #{errors.join(", ")}"

lib/mcp/tool/output_schema.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ def validate_schema!
4242
accept_uri: false,
4343
accept_file: ->(path) { path.to_s.start_with?(Gem.loaded_specs["json-schema"].full_gem_path) },
4444
)
45-
# Get the metaschema for the draft4 validator
4645
metaschema_path = Pathname.new(JSON::Validator.validator_for_name("draft4").metaschema)
47-
# Converts metaschema to a file URI for Windows compatibility
46+
# Converts metaschema to a file URI for cross-platform compatibility
4847
metaschema_uri = JSON::Util::URI.file_uri(metaschema_path.expand_path.cleanpath.to_s.tr("\\", "/"))
4948
metaschema = metaschema_uri.to_s
50-
# Validates the output returning any errors
5149
errors = JSON::Validator.fully_validate(metaschema, schema, schema_reader: schema_reader)
5250
if errors.any?
5351
raise ArgumentError, "Invalid JSON Schema: #{errors.join(", ")}"

0 commit comments

Comments
 (0)