Update Client.listTools return type to include next cursor (#54)

This commit is contained in:
Mattt 2025-04-09 16:20:55 -07:00 • committed by GitHub
commit 20d4fe6f5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -364,7 +364,7 @@ public actor Client {
// MARK: - Tools
public func listTools(cursor: String? = nil) async throws -> [Tool] {
public func listTools(cursor: String? = nil) async throws -> (tools: [Tool], nextCursor: String?) {
try validateServerCapability(\.tools, "Tools")
let request: Request<ListTools>
if let cursor = cursor {
@ -373,7 +373,7 @@ public actor Client {
request = ListTools.request(.init())
}
let result = try await send(request)
return result.tools
return (tools: result.tools, nextCursor: result.nextCursor)
}
public func callTool(name: String, arguments: [String: Value]? = nil) async throws -> (