feat: 2025-11-25 review fixes (#201)

* fix: review fixes of the latest changes

* fix: updated unit tests

* chore: more conformance compliance improvements

* chore: reverted protocol changes

* chore: more compliance improvements

* chore: more conformance compliance improvements

* chore: improvements to the backcompat and updated to Tool unit tests

* chore: ci update
This commit is contained in:
yehorsobko 2026-03-03 16:33:28 +01:00 • committed by GitHub
commit 973b46b8f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,17 +57,17 @@ struct RoundtripTests {
}
await server.withMethodHandler(CallTool.self) { request in
guard request.name == "add" else {
return CallTool.Result(content: [.text("Invalid tool name")], isError: true)
return CallTool.Result(content: [.text(text: "Invalid tool name", annotations: nil, _meta: nil)], isError: true)
}
guard let a = request.arguments?["a"]?.intValue,
let b = request.arguments?["b"]?.intValue
else {
return CallTool.Result(
content: [.text("Did not receive valid arguments")], isError: true)
content: [.text(text: "Did not receive valid arguments", annotations: nil, _meta: nil)], isError: true)
}
return CallTool.Result(content: [.text("\(a + b)")])
return CallTool.Result(content: [.text(text: "\(a + b)", annotations: nil, _meta: nil)])
}
// Add resource handlers to server
@ -151,7 +151,7 @@ struct RoundtripTests {
let callToolTask = Task {
let result = try await client.callTool(name: "add", arguments: ["a": 1, "b": 2])
#expect(result.isError == nil)
#expect(result.content == [.text("3")])
#expect(result.content == [.text(text: "3", annotations: nil, _meta: nil)])
}
try await withThrowingTaskGroup(of: Void.self) { group in