Skip to content

Commit 57010a0

Browse files
authored
Apply suggestions from code review
1 parent 187c7d7 commit 57010a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/MCP/Server/Tools.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public struct Tool: Hashable, Codable, Sendable {
182182
public init(from decoder: Decoder) throws {
183183
let container = try decoder.container(keyedBy: CodingKeys.self)
184184
name = try container.decode(String.self, forKey: .name)
185-
description = try container.decodeIfPresent(String.self, forKey: .description) ?? ""
185+
description = try container.decodeIfPresent(String.self, forKey: .description)
186186
inputSchema = try container.decode(Value.self, forKey: .inputSchema)
187187
annotations =
188188
try container.decodeIfPresent(Tool.Annotations.self, forKey: .annotations) ?? .init()

Tests/MCPTests/ToolTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,6 @@ struct ToolTests {
437437
let tool = try JSONDecoder().decode(Tool.self, from: jsonData)
438438

439439
#expect(tool.name == "test_tool")
440-
#expect(tool.description == "")
440+
#expect(tool.description == nil)
441441
#expect(tool.inputSchema == [:])
442442
}

0 commit comments

Comments
 (0)