|
47 | 47 | tool_class = tool.to_mcp_tool |
48 | 48 | schema = tool_class.input_schema.to_h |
49 | 49 |
|
50 | | - expect(schema[:properties]).to have_key('name') |
51 | | - expect(schema[:properties]['name'][:type]).to eq('string') |
52 | | - expect(schema[:properties]['name'][:description]).to eq('User name') |
| 50 | + expect(schema[:properties]).to have_key(:name) |
| 51 | + expect(schema[:properties][:name][:type]).to eq('string') |
| 52 | + expect(schema[:properties][:name][:description]).to eq('User name') |
53 | 53 |
|
54 | | - expect(schema[:properties]).to have_key('age') |
55 | | - expect(schema[:properties]['age'][:type]).to eq('integer') |
56 | | - expect(schema[:properties]['age'][:description]).to eq('User age') |
| 54 | + expect(schema[:properties]).to have_key(:age) |
| 55 | + expect(schema[:properties][:age][:type]).to eq('integer') |
| 56 | + expect(schema[:properties][:age][:description]).to eq('User age') |
57 | 57 |
|
58 | | - expect(schema[:required]).to eq([:name]) |
| 58 | + expect(schema[:required]).to eq(['name']) |
59 | 59 | end |
60 | 60 |
|
61 | 61 | it 'creates a call method that executes the block' do |
|
107 | 107 | tool_class = tool.to_mcp_tool |
108 | 108 | schema = tool_class.input_schema.to_h |
109 | 109 |
|
110 | | - expect(schema[:properties]['name'][:type]).to eq('string') |
111 | | - expect(schema[:properties]['count'][:type]).to eq('integer') |
112 | | - expect(schema[:properties]['active'][:type]).to eq('boolean') |
| 110 | + expect(schema[:properties][:name][:type]).to eq('string') |
| 111 | + expect(schema[:properties][:count][:type]).to eq('integer') |
| 112 | + expect(schema[:properties][:active][:type]).to eq('boolean') |
113 | 113 |
|
114 | 114 | result = tool_class.call(server_context: nil, name: 'test', count: 5, active: true) |
115 | 115 | expect(result).to be_a(MCP::Tool::Response) |
|
128 | 128 | tool_class = tool.to_mcp_tool |
129 | 129 | schema = tool_class.input_schema.to_h |
130 | 130 |
|
131 | | - expect(schema[:properties]['str'][:type]).to eq('string') |
132 | | - expect(schema[:properties]['int'][:type]).to eq('integer') |
133 | | - expect(schema[:properties]['bool'][:type]).to eq('boolean') |
134 | | - expect(schema[:properties]['arr'][:type]).to eq('array') |
135 | | - expect(schema[:properties]['obj'][:type]).to eq('object') |
| 131 | + expect(schema[:properties][:str][:type]).to eq('string') |
| 132 | + expect(schema[:properties][:int][:type]).to eq('integer') |
| 133 | + expect(schema[:properties][:bool][:type]).to eq('boolean') |
| 134 | + expect(schema[:properties][:arr][:type]).to eq('array') |
| 135 | + expect(schema[:properties][:obj][:type]).to eq('object') |
136 | 136 | end |
137 | 137 |
|
138 | 138 | describe 'return value formatting' do |
|
0 commit comments