Skip to content

Conversation

@yjacquin
Copy link
Owner

I still need to test this out. Turns out it's way simpler than expected.

@yjacquin yjacquin self-assigned this Sep 15, 2025
yjacquin and others added 3 commits September 17, 2025 06:27
Co-authored-by: Almir Davletov <davletovalmir@gmail.com>
@davletovalmir
Copy link

I would personally also add:

  1. A test for arrays with hash structures inside (like required(:field).array(:hash) do ... end) and maybe few more use cases not working well with previous SchemaCompiler
  2. TracePoint to run json schema validation when tool class definition ends (you can add one, run checks and disable on self.inherited), thus making tools with invalid inputSchema fail on startup

Otherwise, thanks for working on this! ❤️

@yjacquin yjacquin requested a review from Copilot September 27, 2025 14:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces FastMCP's custom schema compiler with Dry Schema's built-in JSON schema extension to simplify the codebase. The custom SchemaCompiler class has been entirely removed in favor of using Dry Schema's native JSON schema generation with enhanced metadata handling for descriptions and hidden properties.

Key changes:

  • Removed the custom SchemaCompiler class and related modules
  • Added Dry Schema JSON extension and metadata processing system
  • Enhanced test coverage for schema metadata features

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/mcp/tool_spec.rb Updated test expectations and added comprehensive test coverage for metadata features
spec/mcp/schema_compiler_spec.rb Removed all tests as SchemaCompiler class was deleted
lib/mcp/tool.rb Replaced SchemaCompiler with Dry Schema extension and new metadata processor
examples/tool_examples.rb Added examples demonstrating metadata features
examples/rack_middleware.rb Added example tool with nested hash structure
README.md Minor formatting and content improvements
.rubocop.yml Updated string literal style to use double quotes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

end
end

class DisplayUserAdressTool < FastMcp::Tool
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class name contains a typo: 'DisplayUserAdressTool' should be 'DisplayUserAddressTool' (missing 's' in 'Address').

Suggested change
class DisplayUserAdressTool < FastMcp::Tool
class DisplayUserAddressTool < FastMcp::Tool

Copilot uses AI. Check for mistakes.
@yjacquin yjacquin changed the title PoC of dropping schema compiler to reuse Dry's Drop schema compiler to use Dry's Sep 28, 2025
@yjacquin yjacquin merged commit 2619070 into main Sep 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants