Skip to main content
Glama
Featureflip

Featureflip

Official

Get targeting rules

get_targeting
Read-only

Retrieve a feature flag's targeting configuration for one environment, including enabled status and ordered rules, to inspect how the flag is targeted.

Instructions

Get a flag's current targeting configuration (enabled flag + ordered rules) in one environment.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project": "<project>",
      "flag": "<flag>",
      "environment": "<environment>"
    },
    "name": "get_targeting"
  }
}

Input Schema

NameRequiredDescriptionDefault
flagYesFlag key or id
projectYesProject key
environmentYesEnvironment key, e.g. production

Output Schema

NameRequiredDescriptionDefault
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.
rulesNo
_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.
isEnabledNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedOutput schema / $defs / PublicTargetingRuleResponse / properties / bucketBy
      Added value: +{
      +  "description": "Context attribute the rollout hashes on (default `user_id`; `userId` is accepted as an alias). A context without it skips this rule, even at 100%. Lookup is exact and case-sensitive, except `user_id`/`userId`, which both read the user id.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Changed4 schema fields changedv0.3.0
    • addedInput schema / properties / environment / description
      Added value: +"Environment key, e.g. production"
    • addedInput schema / properties / flag / description
      Added value: +"Flag key or id"
    • addedInput schema / properties / project / description
      Added value: +"Project key"
    • 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"
      +      ]
      +    },
      +    "PublicConditionGroupResponse": {
      +      "description": "A condition group within a PublicTargetingRuleResponse. Maps 1:1 onto\nConditionGroupDto. Operator is a bare wire string naming one of\nthe `ConditionGroupOperator` members (`\"And\"`/`\"Or\"`) —\ngroups are ANDed together at the rule level; within a group, its conditions combine using\nthis operator.",
      +      "properties": {
      +        "conditions": {
      +          "items": {
      +            "anyOf": [
      +              {
      +                "$ref": "#/$defs/PublicConditionResponse"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "type": [
      +            "array",
      +            "null"
      +          ]
      +        },
      +        "operator": {
      +          "description": "Allowed values: And, Or.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "PublicConditionResponse": {
      +      "description": "A single condition within a PublicConditionGroupResponse. Maps 1:1 onto\nConditionDto. Operator is a bare wire string naming one of the\n`OperatorType` members (e.g. `\"Equals\"`, `\"In\"`).",
      +      "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"
      +      ]
      +    },
      +    "PublicTargetingRuleResponse": {
      +      "description": "A single targeting rule, returned by `GET .../rules/{ruleId}`,\n`POST .../rules` (201 body), and nested within PublicTargetingConfigResponse.\nMaps 1:1 onto TargetingRuleDto, dropping nothing — every field on the\nApplication DTO is part of the public contract.",
      +      "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"
      +          ]
      +        },
      +        "conditionGroups": {
      +          "items": {
      +            "anyOf": [
      +              {
      +                "$ref": "#/$defs/PublicConditionGroupResponse"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "type": [
      +            "array",
      +            "null"
      +          ]
      +        },
      +        "description": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "id": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "priority": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "rolloutPercentage": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "userSegmentId": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "variationId": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    }
      +  },
      +  "description": "The full targeting configuration for a flag in a single environment, returned by\n`GET .../targeting`. Maps 1:1 onto TargetingConfigurationDto — including\nits IsEnabled field, which reflects the parent\n`FlagEnvironmentConfiguration.IsEnabled` (whether the flag is on in this environment at\nall), not anything specific to targeting itself.",
      +  "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"
      +      ]
      +    },
      +    "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"
      +    },
      +    "isEnabled": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "rules": {
      +      "items": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/$defs/PublicTargetingRuleResponse"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observedv0.1.6

TDQS

A3.5/5.0
Behavior3/5

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

readOnlyHint=true already establishes the safety profile, and the description adds useful context by saying the response covers the enabled flag plus ordered rules. However, it says nothing about permission requirements or staleness/rate concerns that would be needed to exceed a baseline score with annotations in place.

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

Conciseness4/5

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

A single tight sentence with the resource and scope front-loaded and zero filler. It could not be much shorter without losing the 'one environment' qualifier.

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?

An output schema exists so return-value detail is unnecessary, annotations cover the read-only profile, and all parameters are documented, leaving the description adequately complete. The only gap is the absence of sibling routing guidance.

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 all three parameters (project, flag, environment) carry their own descriptions, so the schema does the heavy lifting. The description only reinforces the environment scoping with 'in one environment' and adds no syntax or format detail beyond the schema.

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?

The description pairs a specific verb (Get) with a precisely scoped resource (a flag's targeting configuration, limited to one environment) and even enumerates the payload shape (enabled flag + ordered rules). It doesn't name the write-side siblings (update_targeting, manage_targeting_rule) it contrasts with, which keeps it from 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 Guidelines3/5

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

Usage is implied by 'current' and 'in one environment', suggesting a read/inspect step before mutation, but there is no explicit when-to-use or when-not guidance and no reference to update_targeting or manage_targeting_rule as alternatives.

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