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:
parent
6112a3995a
commit
973b46b8f7
1 changed files with 692 additions and 507 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue