Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

getProjectFeature

Retrieve detailed information about a specific feature flag within a project using the Unleash MCP Server, enabling precise management of feature toggles.

Instructions

Get detailed information about a feature flag in a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureNameYesName of the feature flag
projectIdYesID of the project

Implementation Reference

  • Handler function that executes the getProjectFeature tool logic: calls the Unleash helper, handles errors, and formats the response as MCP content.
    export async function handleGetProjectFeature({ projectId, featureName }: { projectId: string, featureName: string }) {
      try {
        // Get the feature flag from the project
        const feature = await getProjectFeature(projectId, featureName);
        
        if (!feature) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                projectId,
                featureName,
                error: `Feature '${featureName}' not found in project '${projectId}'` 
              }, null, 2)
            }],
            isError: true
          };
        }
        
        const statusInfo = feature.enabled !== undefined 
          ? `The ${featureName} flag is currently ${feature.enabled ? 'enabled' : 'disabled'}.` 
          : '';
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: true,
              feature,
              summary: `Feature '${featureName}' in project '${projectId}' retrieved successfully. ${statusInfo}`
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              projectId,
              featureName,
              error: error.message || 'An unknown error occurred'
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the getProjectFeature tool: projectId and featureName.
    export const GetProjectFeatureParamsSchema = {
      projectId: z.string().describe('ID of the project'),
      featureName: z.string().describe('Name of the feature flag')
    };
  • src/server.ts:151-155 (registration)
    Registration of the getProjectFeature tool on the MCP server using server.tool().
      getProjectFeatureTool.name,
      getProjectFeatureTool.description,
      getProjectFeatureTool.paramsSchema as any,
      getProjectFeatureTool.handler as any
    );
  • Supporting function that performs the actual API request to retrieve a specific feature flag from Unleash.
    export async function getProjectFeature(projectId: string, featureName: string): Promise<any | null> {
      try {
        const response = await client.get(`/api/admin/projects/${projectId}/features/${featureName}`);
        logger.info(`Successfully fetched feature ${featureName} from project ${projectId}`);
        return response.data;
      } catch (error: any) {
        logger.error(`Error fetching feature ${featureName} from project ${projectId}:`, error);
        if (error.response && error.response.status === 404) {
          logger.info(`Feature ${featureName} not found in project ${projectId}`);
          return null;
        }
        throw error;
      }
    } 
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. While 'Get detailed information' implies a read-only operation, it doesn't specify aspects like authentication requirements, rate limits, error conditions, or the format of the returned information. This leaves significant gaps for a tool with no annotation coverage.

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 front-loads the core purpose without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it appropriately sized and well-structured.

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 lack of annotations and output schema, the description is incomplete for a tool that retrieves detailed information. It doesn't explain what 'detailed information' includes, how results are formatted, or any behavioral traits like error handling, leaving the agent with insufficient context to use the tool effectively.

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 schema description coverage is 100%, with both parameters ('featureName' and 'projectId') clearly documented in the schema. The description adds no additional meaning beyond implying that these parameters are used to retrieve information, which aligns with the schema but doesn't provide extra context like examples or constraints.

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 ('Get detailed information') and the resource ('about a feature flag in a specific project'), making the purpose unambiguous. However, it doesn't distinguish this tool from similar siblings like 'getFlag' or 'getProjectFeatures', which appears to retrieve multiple features rather than a single one.

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. With siblings like 'getFlag' and 'getProjectFeatures' available, the description lacks any indication of context, prerequisites, or exclusions that would help an agent choose appropriately.

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