@@ -202,11 +202,13 @@ def convert_openapi_to_mcp_tools(
202202 param_desc = param .get ("description" , "" )
203203 param_required = param .get ("required" , True ) # Path params are usually required
204204
205- properties [param_name ] = {
206- "type" : param_schema .get ("type" , "string" ),
207- "title" : param_name ,
208- "description" : param_desc ,
209- }
205+ properties [param_name ] = param_schema .copy ()
206+ properties [param_name ]["title" ] = param_name
207+ if param_desc :
208+ properties [param_name ]["description" ] = param_desc
209+
210+ if "type" not in properties [param_name ]:
211+ properties [param_name ]["type" ] = param_schema .get ("type" , "string" )
210212
211213 if param_required :
212214 required_props .append (param_name )
@@ -217,11 +219,14 @@ def convert_openapi_to_mcp_tools(
217219 param_desc = param .get ("description" , "" )
218220 param_required = param .get ("required" , False )
219221
220- properties [param_name ] = {
221- "type" : get_single_param_type_from_schema (param_schema ),
222- "title" : param_name ,
223- "description" : param_desc ,
224- }
222+ properties [param_name ] = param_schema .copy ()
223+ properties [param_name ]["title" ] = param_name
224+ if param_desc :
225+ properties [param_name ]["description" ] = param_desc
226+
227+ if "type" not in properties [param_name ]:
228+ properties [param_name ]["type" ] = get_single_param_type_from_schema (param_schema )
229+
225230 if "default" in param_schema :
226231 properties [param_name ]["default" ] = param_schema ["default" ]
227232
@@ -233,10 +238,14 @@ def convert_openapi_to_mcp_tools(
233238 param_schema = param .get ("schema" , {})
234239 param_required = param .get ("required" , False )
235240
236- properties [param_name ] = {
237- "type" : get_single_param_type_from_schema (param_schema ),
238- "title" : param_name ,
239- }
241+ properties [param_name ] = param_schema .copy ()
242+ properties [param_name ]["title" ] = param_name
243+ if param_desc :
244+ properties [param_name ]["description" ] = param_desc
245+
246+ if "type" not in properties [param_name ]:
247+ properties [param_name ]["type" ] = get_single_param_type_from_schema (param_schema )
248+
240249 if "default" in param_schema :
241250 properties [param_name ]["default" ] = param_schema ["default" ]
242251
0 commit comments