Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/MCP/Client/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 -> (
Expand Down
6 changes: 3 additions & 3 deletions Tests/MCPTests/RoundtripTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ struct RoundtripTests {
}

let listToolsTask = Task {
let result = try await client.listTools()
#expect(result.count == 1)
#expect(result[0].name == "add")
let (tools, _) = try await client.listTools()
#expect(tools.count == 1)
#expect(tools[0].name == "add")
}

let callToolTask = Task {
Expand Down