@@ -12,34 +12,8 @@ extension Array where Element == MCPToolMetadata {
1212 return self . map { meta in
1313 // Create properties for the JSON schema
1414 let properties = Dictionary ( uniqueKeysWithValues: meta. parameters. map { param in
15- // Create the appropriate schema based on the parameter type
16- let schema : JSONSchema
17- let jsonSchemaType = param. type. JSONSchemaType
18-
19- if jsonSchemaType == " array " {
20- // This is an array type
21- let elementType : JSONSchema
22- if let arrayElementType = param. type. arrayElementType {
23- if arrayElementType. JSONSchemaType == " number " {
24- elementType = JSONSchema . number ( )
25- } else if arrayElementType. JSONSchemaType == " boolean " {
26- elementType = JSONSchema . boolean ( )
27- } else {
28- elementType = JSONSchema . string ( )
29- }
30- } else {
31- elementType = JSONSchema . string ( )
32- }
33- schema = JSONSchema . array ( items: elementType, description: param. description)
34- } else if jsonSchemaType == " number " {
35- schema = JSONSchema . number ( description: param. description)
36- } else if jsonSchemaType == " boolean " {
37- schema = JSONSchema . boolean ( description: param. description)
38- } else {
39- schema = JSONSchema . string ( description: param. description)
40- }
41-
42- return ( param. name, schema)
15+
16+ return ( param. name, param. jsonSchema)
4317 } )
4418
4519 // Determine which parameters are required (those without default values)
0 commit comments