Make CallTool.Result.isError optional (#11)

This commit is contained in:
Mattt 2025-03-14 06:24:46 -07:00 • committed by GitHub
commit a62e51a61c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 9 deletions

View file

@ -344,7 +344,7 @@ public actor Client {
}
public func callTool(name: String, arguments: [String: Value]? = nil) async throws -> (
content: [Tool.Content], isError: Bool
content: [Tool.Content], isError: Bool?
) {
_ = try checkCapability(\.tools, "Tools")
let request = CallTool.request(.init(name: name, arguments: arguments))

View file

@ -154,9 +154,9 @@ public enum CallTool: Method {
public struct Result: Hashable, Codable, Sendable {
public let content: [Tool.Content]
public let isError: Bool
public let isError: Bool?
public init(content: [Tool.Content], isError: Bool) {
public init(content: [Tool.Content], isError: Bool? = nil) {
self.content = content
self.isError = isError
}