@@ -14,7 +14,7 @@ public struct Tool: Hashable, Codable, Sendable {
1414 /// The tool description
1515 public let description : String
1616 /// The tool input schema
17- public let inputSchema : Value ?
17+ public let inputSchema : Value
1818
1919 /// Annotations that provide display-facing and operational information for a Tool.
2020 ///
@@ -86,7 +86,7 @@ public struct Tool: Hashable, Codable, Sendable {
8686 public init (
8787 name: String ,
8888 description: String ,
89- inputSchema: Value ? = nil ,
89+ inputSchema: Value ,
9090 annotations: Annotations = nil
9191 ) {
9292 self . name = name
@@ -183,7 +183,7 @@ public struct Tool: Hashable, Codable, Sendable {
183183 let container = try decoder. container ( keyedBy: CodingKeys . self)
184184 name = try container. decode ( String . self, forKey: . name)
185185 description = try container. decode ( String . self, forKey: . description)
186- inputSchema = try container. decodeIfPresent ( Value . self, forKey: . inputSchema)
186+ inputSchema = try container. decode ( Value . self, forKey: . inputSchema)
187187 annotations =
188188 try container. decodeIfPresent ( Tool . Annotations. self, forKey: . annotations) ?? . init( )
189189 }
@@ -192,9 +192,7 @@ public struct Tool: Hashable, Codable, Sendable {
192192 var container = encoder. container ( keyedBy: CodingKeys . self)
193193 try container. encode ( name, forKey: . name)
194194 try container. encode ( description, forKey: . description)
195- if let schema = inputSchema {
196- try container. encode ( schema, forKey: . inputSchema)
197- }
195+ try container. encode ( inputSchema, forKey: . inputSchema)
198196 if !annotations. isEmpty {
199197 try container. encode ( annotations, forKey: . annotations)
200198 }
0 commit comments