Skip to content

Add pagination for list_fme_workspaces#35

Open
joe-hagerman wants to merge 1 commit intoharness:masterfrom
joe-hagerman:add-pagination-to-list_fme_workspaces
Open

Add pagination for list_fme_workspaces#35
joe-hagerman wants to merge 1 commit intoharness:masterfrom
joe-hagerman:add-pagination-to-list_fme_workspaces

Conversation

@joe-hagerman
Copy link

  • Added pagination support to list_fme_workspaces tool by exposing the offset and limit query parameters supported by the underlying Split.io API (GET /internal/api/v2/workspaces)
  • Updated FMEService.ListWorkspaces client method to accept offset and limit int parameters and pass them as query params
  • Added optional offset and count number parameters to the list_fme_workspaces MCP tool definition; defaults to count=20 if not provided, capped at a maximum of 1000 per the Split.io API documentation
  • Updated README to document the new pagination parameters for list_fme_workspaces

// ListWorkspaces retrieves FME workspaces with pagination support.
// GET https://api.split.io/internal/api/v2/workspaces
func (f *FMEService) ListWorkspaces(ctx context.Context) (*dto.FMEWorkspacesResponse, error) {
// offset specifies the number of items to skip; limit controls how many items to return (max 100).
Copy link
Contributor

Choose a reason for hiding this comment

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

looks to be max 1000

mcp.WithNumber("offset",
mcp.Description("The number of workspaces to skip for pagination (default: 0)"),
),
mcp.WithNumber("count",
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We could use "limit" to keep naming consistent with the API. Feel free to ignore this though

),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
workspaces, err := fmeService.ListWorkspaces(ctx)
offset, err := OptionalIntParam(request, "offset")
Copy link
Contributor

Choose a reason for hiding this comment

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

check for negative offset?

@rgrassian-split
Copy link
Contributor

Thank you for the suggestions! I can take things from here and get this implemented.

thisrohangupta added a commit to thisrohangupta/harness-mcp-v2 that referenced this pull request Mar 6, 2026
Adds offset and limit query params to the FME workspace list endpoint,
matching the Split.io API (GET /internal/api/v2/workspaces). Users can
pass offset and size params via harness_list.

Parity with harness/mcp-server#35.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
thisrohangupta added a commit to thisrohangupta/harness-mcp-v2 that referenced this pull request Mar 6, 2026
feat: add pagination to fme_workspace list (parity with harness/mcp-server#35)
Copy link

@MontaEllis8 MontaEllis8 left a comment

Choose a reason for hiding this comment

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

✅ Code Review 通过

添加分页功能。

建议合并。

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.

3 participants