Skip to main content
Glama
canopy-labs

Featureflip

Official

Find stale flags

find_stale_flags
Read-only

Identify feature flags that are stale and ready for cleanup: not updated in N days and enabled or disabled in all environments, or expired. Filter by owner.

Instructions

Find flags that look ready for code cleanup: not updated in N days AND either enabled in every environment (verify rollout is complete before removing — per-rule percentage ramps are not inspected) or disabled in every environment (dead — remove flag and code path). A flag whose expiry date (set_flag_expiry) has passed is always a candidate, however recently it was edited; if it is on in some environments and off in others its reason is past-expiry, meaning the owner has to decide which way to fold it. Every result carries expiresAtUtc, expired and owner (null when unowned). Pass owner to see one person's stale flags ("me" for your own) or "none" for the unowned ones. Every result also carries blockedBy: the live flags that still list it as a prerequisite, which have to be removed and archived before it ([] when none). blockedBy is null when the server did not classify the flag as a removal candidate, which means unknown, not unblocked. A flag that other live flags list as a prerequisite has to be removed LAST, dependents first: archiving it while a dependent still names it makes that dependent fail its prerequisite check and serve its off variation, so archive_flag refuses it with FLAG_HAS_DEPENDENTS. Checks at most 50 candidates per call, expired flags first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoMinimum age in days since last update
ownerNoOnly flags with this owner: an email, "me" for the token's own user, or "none" for unowned flags
projectYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.9
    • addedInput schema / properties / owner
      Added value: +{
      +  "description": "Only flags with this owner: an email, \"me\" for the token's own user, or \"none\" for unowned flags",
      +  "type": "string"
      +}
  2. First observedv0.1.6

TDQS

A4.6/5.0
Behavior5/5

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

With readOnlyHint already covering safety, the description adds substantial behavior: blockedBy null means unknown not unblocked, the 50-candidate cap with expired-first ordering, per-rule percentage ramps not being inspected, and the mandatory dependents-first removal order that triggers FLAG_HAS_DEPENDENTS. This is rich context beyond the annotations.

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?

It is long and dense, but front-loaded with the core definition and the sentences carry distinct information (candidate rules, return fields, dependency ordering, cap). A few clauses are run-on, but nothing is filler.

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

Completeness5/5

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

There is no output schema, so the description must explain returns, which it does thoroughly (expiresAtUtc, expired, owner with null-when-unowned, blockedBy including the null semantics). Combined with the cap, ordering, and dependency warnings, an agent has everything needed to call and act on results.

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

Parameters4/5

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

Schema coverage is 67%, so the schema carries much of the load, but the description adds meaning: owner accepts an email, 'me', or 'none' (schema already lists these but the description gives usage intent), and days is qualified by the rule that a past expiry date always makes a flag a candidate regardless of edit recency. Only project is left unexplained.

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?

It names a specific verb+resource (find stale flags ready for code cleanup) and precisely defines the scope: not updated in N days AND enabled everywhere or disabled everywhere. The preconditions distinguish it from a generic flag listing and it routes cleanup work implicitly away from archive_flag.

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

Usage Guidelines4/5

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

It clearly explains the conditions that make a flag a candidate, the expiry-date override, and how to scope by owner ('me'/'none'). It also warns to verify rollout completeness before removing and explains the FLAG_HAS_DEPENDENTS refusal, but it does not explicitly name an alternative tool or a when-not-to-use case.

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