Skip to content

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

Merged
mattt merged 1 commit into
mainfrom
mattt/change-listtools-return-type
Apr 9, 2025
Merged

Update Client.listTools return type to include next cursor#54
mattt merged 1 commit into
mainfrom
mattt/change-listtools-return-type

Conversation

@mattt

@mattt mattt commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

Resolves #49

This PR introduces a breaking change to Client.listTools, making it return a tuple of ([Tool], String?), instead of its current [Tool]. This change makes listTools consistent with the other list methods, and allows it to support pagination.

// New usage
let (tools, nextCursor) = try await client.listTools()


// Old usage
let tools = try await client.listTools()

@stallent stallent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, good sir.

@mattt mattt merged commit 20d4fe6 into main Apr 9, 2025
@mattt mattt deleted the mattt/change-listtools-return-type branch April 9, 2025 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent return type for Client.listTools method

2 participants