Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

getFlag

Retrieve detailed information about a specific feature flag in the Unleash MCP server to manage and understand feature toggle configurations.

Instructions

Get detailed information about a feature flag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flagNameYes

Implementation Reference

  • The main handler function that implements the core logic of the 'getFlag' tool. It retrieves feature flag details using getFeatureFlag, handles errors, and returns a structured JSON response.
    export async function handleGetFlag({ flagName }: { flagName: string }) {
      try {
        // Get the feature flag
        const flag = await getFeatureFlag(flagName);
        
        if (!flag) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                flagName,
                error: `Feature flag '${flagName}' not found` 
              }, null, 2)
            }],
            isError: true
          };
        }
        
        const summary = `The ${flagName} flag is currently ${flag.enabled ? 'enabled' : 'disabled'}.`;
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              flag,
              summary
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              flagName,
              error: error.message 
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the getFlag tool, specifically the required 'flagName' string parameter.
    export const GetFlagParamsSchema = {
      flagName: z.string()
    };
  • src/server.ts:87-92 (registration)
    The registration of the getFlag tool on the MCP server instance using server.tool(), referencing the tool's name, description, schema, and handler.
    server.tool(
      getFlagTool.name,
      getFlagTool.description,
      getFlagTool.paramsSchema as any,
      getFlagTool.handler as any
    );
  • The tool definition object that bundles the name, description, schema, and handler for easy import and registration.
    export const getFlagTool = {
      name: "getFlag",
      description: "Get detailed information about a feature flag",
      paramsSchema: GetFlagParamsSchema,
      handler: handleGetFlag
    }; 
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), implying it's non-destructive, but doesn't cover aspects like authentication needs, rate limits, error handling, or what 'detailed information' entails. This leaves significant gaps for a tool with no structured safety hints.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given the tool's complexity (a read operation with 1 parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, potential errors, or how it differs from sibling tools, leaving the agent with insufficient context for reliable use.

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?

The input schema has 1 parameter with 0% description coverage, so the schema provides no semantic details. The description adds minimal context by implying 'flagName' is used to identify a specific feature flag, but doesn't specify format, examples, or constraints. This partially compensates for the low schema coverage but remains vague.

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 clearly states the verb ('Get') and resource ('detailed information about a feature flag'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'listFlags' or 'getProjectFeature', which also retrieve flag-related information, so it doesn't fully differentiate from alternatives.

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 provides no guidance on when to use this tool versus alternatives such as 'listFlags' (for multiple flags) or 'getProjectFeature' (for project-specific flags). There's no mention of prerequisites, context, or exclusions, leaving the agent with minimal usage direction.

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

Related 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/cuongtl1992/unleash-mcp'

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