File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ public actor Client {
364364
365365 // MARK: - Tools
366366
367- public func listTools( cursor: String ? = nil ) async throws -> [ Tool ] {
367+ public func listTools( cursor: String ? = nil ) async throws -> ( tools : [ Tool ] , nextCursor : String ? ) {
368368 try validateServerCapability ( \. tools, " Tools " )
369369 let request : Request < ListTools >
370370 if let cursor = cursor {
@@ -373,7 +373,7 @@ public actor Client {
373373 request = ListTools . request ( . init( ) )
374374 }
375375 let result = try await send ( request)
376- return result. tools
376+ return ( tools : result. tools, nextCursor : result . nextCursor )
377377 }
378378
379379 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 {
144144 }
145145
146146 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 " )
150150 }
151151
152152 let callToolTask = Task {
You can’t perform that action at this time.
0 commit comments