Skip to main content
Glama
ylin6

Unleash Feature Flag MCP Server

by ylin6

getFeatureFlag

Retrieve a specific feature flag from an Unleash project to check its status and configuration. Provide the project ID and feature ID to get current flag details.

Instructions

Retrieve a specific feature flag from a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureIdYes
projectIdYes

Implementation Reference

  • Executes the getFeatureFlag tool by parsing parameters with GetFeatureFlagSchema, querying the Unleash API endpoint for the specific feature flag using projectId and featureId, and returning the response data or throwing an error.
    async function getFeatureFlag(params: z.infer<typeof GetFeatureFlagSchema>) {
      const { projectId, featureId } = GetFeatureFlagSchema.parse(params);
      try {
        const response = await axios.get(
          `${UNLEASH_API_URL}/api/admin/projects/${projectId}/features/${featureId}`,
          {
            headers: {
              Authorization: `Bearer ${UNLEASH_AUTH_TOKEN}`,
            },
          }
        );
        return response.data;
      } catch (error) {
        console.error('Error fetching feature flag:', error);
        throw error;
      }
    }
  • Raw Zod object shape defining the input parameters for getFeatureFlag: projectId and featureId as strings. Used in MCP tool registration.
    const RawGetFeatureFlagShape = {
      projectId: z.string(),
      featureId: z.string(),
    };
  • Full Zod schema for validating getFeatureFlag input parameters, based on the raw shape. Used in the handler function.
    const GetFeatureFlagSchema = z.object(RawGetFeatureFlagShape);
  • src/index.ts:61-69 (registration)
    Registers the getFeatureFlag tool on the MCP server with name, description, input schema (RawGetFeatureFlagShape), and an async handler that invokes the core getFeatureFlag function and formats the JSON response.
    server.tool(
      'getFeatureFlag',
      'Retrieve a specific feature flag from a project',
      RawGetFeatureFlagShape,
      async (args) => {
        const data = await getFeatureFlag(args);
        return { content: [{ type: 'text', text: JSON.stringify(data) }] };
      }
    );
Behavior2/5

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

With no annotations, the description carries full burden but only states it's a retrieval operation. It doesn't disclose behavioral traits such as error handling (e.g., if the flag doesn't exist), authentication needs, rate limits, or what the return format looks like (since there's no output schema).

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 with no wasted words, clearly front-loading the core action. It's appropriately sized for a simple retrieval tool, though it could benefit from additional context.

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 2 required parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover parameter meanings, usage context, or return values, making it inadequate for an agent to use the tool effectively without guesswork.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter details. It doesn't explain what 'featureId' and 'projectId' represent, their formats, or how they relate to retrieving the flag, leaving parameters undocumented beyond their names in 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 clearly states the action ('Retrieve') and target ('a specific feature flag from a project'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'getFeatures' (which likely retrieves multiple flags) or specify what makes a flag 'specific' (e.g., by ID).

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?

No guidance is provided on when to use this tool versus alternatives like 'getFeatures' (for listing flags) or 'createFeatureFlag'/'updateFeatureFlag' (for modifications). The description implies it's for retrieving a single flag but doesn't clarify prerequisites or exclusions.

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/ylin6/unleash-ff-mcp-server'

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