Skip to main content
Glama
Unleash

Unleash MCP Server

Official
by Unleash

detect_flag

Detect existing feature flags in your codebase to prevent duplicates and encourage reuse. Uses file search, git history, semantic matching, and code context analysis.

Instructions

Discover existing feature flags in the codebase to prevent duplicates and encourage reuse.

This tool provides comprehensive search instructions for finding existing flags through multiple detection strategies:

  • File-based detection: Search in files being modified

  • Git history analysis: Find recently added flags

  • Semantic name matching: Match description to flag names

  • Code context analysis: Find flags near modification point

Use this tool when:

  • About to create a new feature flag

  • Evaluating whether a flag is needed

  • Want to check if similar functionality is already flagged

The tool returns detailed search instructions that guide you through:

  1. Executing searches using Bash and Grep tools

  2. Scoring candidates from multiple detection methods

  3. Combining results to find the best match

  4. Returning a confidence-scored recommendation

Workflow Integration: This tool is automatically called by 'evaluate_change' before recommending 'create_flag'. You can also call it directly when you want to search for existing flags.

Output: Returns markdown guidance with:

  • Step-by-step search instructions for each detection method

  • Scoring criteria and weight calculations

  • Expected JSON response format

  • Confidence level interpretation

After following the instructions and finding results, you should return a JSON object indicating whether a flag was found and, if so, its details with a confidence score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesDescription of the change or feature you want to find flags for (e.g., "payment processing with Stripe")
filesNoOptional: List of files being modified to search for flags in the same area
codeContextNoOptional: Code context around the modification point to analyze for nearby flags
Behavior5/5

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

No annotations provided, but the description fully discloses that the tool returns search instructions, not actual flags. It explains the multi-step process, output format, and expected user actions, making behavioral expectations completely transparent.

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?

The description is well-structured with sections for purpose, strategies, usage, workflow, and output. It is somewhat verbose but every section adds value, and the front-loading of purpose is effective.

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?

Given no annotations and no output schema, the description provides complete guidance: explains the tool's meta-nature, return format (markdown instructions), workflow steps, and expected final output format. It covers all necessary context for an agent to use the tool correctly.

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 description coverage is 100% with clear descriptions for all three parameters. The tool description adds context by relating parameters to detection strategies (e.g., files to file-based detection), enhancing understanding beyond 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?

The description clearly states the tool discovers existing feature flags to prevent duplicates and encourage reuse, listing specific detection strategies. It distinguishes itself from sibling tools like create_flag and list_flags by describing its role as a discovery tool before creation.

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

Usage Guidelines5/5

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

Explicitly states when to use the tool: when about to create a new flag, evaluating necessity, or checking for similar functionality. Also mentions it's automatically called by evaluate_change before create_flag, providing clear workflow integration context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Unleash/unleash-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server