Skip to content

Add pagination for list_fme_feature_flags#34

Open
joe-hagerman wants to merge 2 commits intoharness:masterfrom
joe-hagerman:add-pagination-to-list_fme_feature_flags
Open

Add pagination for list_fme_feature_flags#34
joe-hagerman wants to merge 2 commits intoharness:masterfrom
joe-hagerman:add-pagination-to-list_fme_feature_flags

Conversation

@joe-hagerman
Copy link

@joe-hagerman joe-hagerman commented Mar 3, 2026

  • Added pagination support to list_fme_feature_flags tool by exposing the offset and limit query parameters already supported by the underlying Split.io API (GET /internal/api/v2/splits/ws/{wsId})
  • Updated FMEService.ListFeatureFlags 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_feature_flags MCP tool definition; defaults to count=20 if not provided, capped at a maximum of 50 to match the split.io api documentation.
  • Updated README to document the new pagination parameters for list_fme_feature_flags

@CLAassistant
Copy link

CLAassistant commented Mar 3, 2026

CLA assistant check
All committers have signed the CLA.

@joe-hagerman joe-hagerman force-pushed the add-pagination-to-list_fme_feature_flags branch from 76090d3 to c77b0ef Compare March 3, 2026 20:43
Copy link
Contributor

@rgrassian-split rgrassian-split left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments

mcp.WithNumber("offset",
mcp.Description("The number of feature flags 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

// ListFeatureFlags retrieves feature flags for a specific workspace with pagination support.
// GET https://api.split.io/internal/api/v2/splits/ws/{wsId}
func (f *FMEService) ListFeatureFlags(ctx context.Context, wsID string) (*dto.FMEFeatureFlagsResponse, 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.

comment says max 100, but it looks like a max of 50 is actually used

}

featureFlags, err := fmeService.ListFeatureFlags(ctx, wsID)
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.

nit: check for offset < 0

@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 fme_feature_flag resource type with list operation using
GET /internal/api/v2/splits/ws/{wsId}. Supports offset and limit
query params (default 20, max 50 per Split.io docs).

Parity with harness/mcp-server#34.

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
Adds fme_feature_flag resource type with list operation using
GET /internal/api/v2/splits/ws/{wsId}. Supports offset and limit
query params (default 20, max 50 per Split.io docs).

Parity with harness/mcp-server#34.

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
…-pagination

feat: add fme_feature_flag list with pagination (parity with harness/mcp-server#34)
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.

4 participants