Skip to main content
Glama
canopy-labs

Featureflip

Official

Get user segment

get_segment
Read-only

Retrieve a user segment's conditions, ID, and metadata by key or ID within a Featureflip project.

Instructions

Get one user segment (its conditions, id, and metadata) by key or id.

Input Schema

NameRequiredDescriptionDefault
projectYesProject key
segmentYesSegment key or id

Output Schema

NameRequiredDescriptionDefault
idNo
keyNo
etagNoETag of what was read. Pass it as ifMatch on the matching update so the write is refused (412) instead of overwriting a change made since.
nameNo
_actionsNoCapability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.
createdAtNo
updatedAtNo
conditionsNo
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "ActionCapability": {
      +      "description": "One entry in a resource's `_actions` block: may the caller perform it, and if not, why.",
      +      "properties": {
      +        "allowed": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "reason": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "PublicSegmentConditionDto": {
      +      "description": "A single targeting condition on a segment, used both as input (create/update) and output\n(Conditions). Operator is a bare string on\nboth sides of the wire — on write it's parsed to\nOperatorType by `SegmentsController` (an unknown\nvalue fails closed with a 400, never silently dropped or defaulted); on read it's mapped\nstraight through from Operator, which is already a string.",
      +      "properties": {
      +        "attribute": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "negate": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "operator": {
      +          "description": "Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "values": {
      +          "items": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "type": [
      +            "array",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    }
      +  },
      +  "description": "Public representation of a user segment, returned by `GET .../segments`,\n`GET .../segments/{segment}`, and the body of a successful create.",
      +  "properties": {
      +    "_actions": {
      +      "additionalProperties": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/$defs/ActionCapability"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "description": "Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "conditions": {
      +      "items": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/$defs/PublicSegmentConditionDto"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "createdAt": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "description": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "etag": {
      +      "description": "ETag of what was read. Pass it as ifMatch on the matching update so the write is refused (412) instead of overwriting a change made since.",
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "key": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "name": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "updatedAt": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv0.1.6

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

readOnlyHint=true already tells the agent this is a safe read, so the bar is lower. The description adds that the response covers conditions, id, and metadata, which is mild value, but says nothing about not-found behavior or required permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence, front-loaded with the verb and resource, with the lookup keys trailing. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter read tool with a full output schema and readOnly annotation, the description covers purpose and lookup keys adequately; return values need not be explained. Only error/not-found handling is unaddressed, a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and both parameters are documented ('Project key', 'Segment key or id'). The description's 'by key or id' merely restates the schema's own wording rather than adding new meaning, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Get one user segment') with singular scope and the lookup keys, which implicitly separates it from list_segments and manage_segment. It does not explicitly name or contrast a sibling, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no when-to-use guidance, no exclusions, and never mentions the alternative list_segments or manage_segment. An agent must infer from the tool name alone that this is the single-item read path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.