Skip to content

Hosted MCP: get_segment truncates context targets without pagination or exact lookup #97

Open

Description

@josh956

The hosted MCP get_segment response truncates standard-segment context target arrays after ten values, without exposing pagination or an exact-target lookup. This prevents a client from verifying membership for a target outside the displayed prefix

This report concerns https://mcp.launchdarkly.com/mcp/launchdarkly, not a reproduced defect in this generated local server. Filing here per the repository contribution guidance; please route to the hosted MCP maintainers if needed

Reproduction

  1. Use a standard segment (unbounded: false) with 37 explicit targets of one context kind and no rules
  2. Call hosted get_segment with its project, environment, and segment keys
  3. Inspect includedContexts in both the text and structured responses

Observed shape, with synthetic identifiers:

{
  "includedContexts": [{
    "contextKind": "company",
    "count": 37,
    "values": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "...27 more"]
  }]
}

The advertised get_segment input schema accepts only project, environment, and segment keys. list_segments returns counts rather than the missing targets

Expected behavior and proposed fix

Preserve complete target arrays from the REST Get segment endpoint, or expose paginated targets with explicit continuation metadata. A dedicated exact-context lookup would also solve membership questions without returning large arrays

Avoid putting a truncation marker in an array of actual identifiers. A missing identifier in a truncated response cannot establish non-membership

Regression cases

  • All 37 synthetic targets can be retrieved, including a target after position ten
  • Both included and excluded context targets remain accessible
  • Legacy user targets and non-user context kinds stay distinct
  • If pagination is used, concatenating pages returns every target once on an unchanged segment
  • An exact lookup distinguishes explicit inclusion/exclusion from rule-based membership that requires evaluation
  • Big/synced segments do not imply complete membership from standard target arrays

REST API reference: https://launchdarkly.com/docs/api/segments/get-segment

Observed October 23, 2026 through a Codex MCP client on macOS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions