File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ public actor Client {
364
364
365
365
// MARK: - Tools
366
366
367
- public func listTools( cursor: String ? = nil ) async throws -> [ Tool ] {
367
+ public func listTools( cursor: String ? = nil ) async throws -> ( tools : [ Tool ] , nextCursor : String ? ) {
368
368
try validateServerCapability ( \. tools, " Tools " )
369
369
let request : Request < ListTools >
370
370
if let cursor = cursor {
@@ -373,7 +373,7 @@ public actor Client {
373
373
request = ListTools . request ( . init( ) )
374
374
}
375
375
let result = try await send ( request)
376
- return result. tools
376
+ return ( tools : result. tools, nextCursor : result . nextCursor )
377
377
}
378
378
379
379
public func callTool( name: String , arguments: [ String : Value ] ? = nil ) async throws -> (
Original file line number Diff line number Diff line change @@ -144,9 +144,9 @@ struct RoundtripTests {
144
144
}
145
145
146
146
let listToolsTask = Task {
147
- let result = try await client. listTools ( )
148
- #expect( result . count == 1 )
149
- #expect( result [ 0 ] . name == " add " )
147
+ let ( tools , _ ) = try await client. listTools ( )
148
+ #expect( tools . count == 1 )
149
+ #expect( tools [ 0 ] . name == " add " )
150
150
}
151
151
152
152
let callToolTask = Task {
You can’t perform that action at this time.
0 commit comments