Skip to main content
Glama
canopy-labs

Featureflip

Official

Get targeting rules

get_targeting
Read-only

Retrieve a feature flag's current targeting configuration (enabled status and ordered rules) for one environment. Use it to inspect rollout logic before editing.

Instructions

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

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. 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"
      +}
  2. First observedv0.1.6

TDQS

A3.6/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. The description adds the useful scope detail that it returns the enabled flag plus ordered rules for a single environment, but it does not cover return format or whether ordering is significant beyond what the schema/output schema implies.

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 front-loaded sentence with no filler, immediately stating the verb, resource, and returned content. Every clause earns its place.

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?

With an output schema present, the description needn't explain return values, and the three required params are covered by the schema. It is complete enough for an agent to call correctly, though it lacks explicit routing context versus targeting siblings.

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%, so all three parameters (project, flag, environment) are documented in the schema, meeting the baseline of 3. The description's phrase 'in one environment' reinforces the environment scoping but adds no format or syntax detail beyond the schema.

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

Purpose5/5

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

States a specific verb (Get) and resource (a flag's targeting configuration), and clarifies the scope: enabled flag plus ordered rules, in one environment. This clearly distinguishes it from write siblings like update_targeting and manage_targeting_rule.

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 and names no alternatives. It neither says when to prefer update_targeting to modify rules nor states any prerequisites, so the agent must infer the read-only inspection use case from the verb alone.

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