Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

getProjectFeatures

Retrieve all feature toggles for a specific project from Unleash MCP, enabling centralized management and visibility of feature configurations.

Instructions

Get all features for a specific project from the Unleash repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes

Implementation Reference

  • The handler function that executes the tool logic: fetches project features using the helper function and returns formatted JSON response or error.
    export async function handleGetProjectFeatures(params: {
      projectId: string;
    }) {
      try {
        // Get the project features
        const features = await getProjectFeatures(params.projectId);
        
        if (!features) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                error: `Failed to fetch features for project '${params.projectId}'` 
              }, null, 2)
            }],
            isError: true
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: true,
              message: `Successfully fetched features for project '${params.projectId}'`,
              features: features
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              error: error.message 
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Input schema validation using Zod for the projectId parameter.
    export const GetProjectFeaturesParamsSchema = {
      projectId: z.string().min(1)
    };
  • src/server.ts:143-148 (registration)
    Registration of the getProjectFeatures tool in the MCP server using server.tool().
    server.tool(
      getProjectFeaturesTool.name,
      getProjectFeaturesTool.description,
      getProjectFeaturesTool.paramsSchema as any,
      getProjectFeaturesTool.handler as any
    );
  • Helper function that performs the actual API call to retrieve project features from Unleash.
    export async function getProjectFeatures(projectId: string): Promise<any[] | null> {
      try {
        const response = await client.get(`/api/admin/projects/${projectId}/features`);
        logger.info(`Successfully fetched features for project ${projectId}`);
        return response.data.features || response.data;
      } catch (error) {
        logger.error(`Error fetching features for project ${projectId}:`, error);
        return null;
      }
    } 
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it 'gets' features, implying a read operation, but doesn't disclose behavioral traits like whether it returns all features at once (pagination?), format of returned data, authentication needs, rate limits, or error conditions. The description is minimal and lacks operational context.

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, clear sentence with zero waste. It's front-loaded with the core purpose ('Get all features for a specific project'), and the additional context ('from the Unleash repository') is necessary for source identification. Every word earns its place.

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 no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It lacks details on return values (e.g., structure of features list), error handling, authentication, and operational constraints. For a tool with one parameter but no schema documentation, more context is needed to guide effective 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?

Schema description coverage is 0%, so the description must compensate. It mentions 'for a specific project' which hints at the 'projectId' parameter, adding semantic context beyond the schema's bare type/constraints. However, it doesn't explain what a 'projectId' is (e.g., format, where to find it) or provide examples, leaving gaps in parameter understanding.

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 ('all features for a specific project'), specifying the source ('from the Unleash repository'). It distinguishes from siblings like 'getFlag' (single feature) and 'listFlags' (all flags without project context). However, it doesn't explicitly contrast with 'getProjectFeature' (singular vs plural).

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 explicit guidance on when to use this tool versus alternatives. The description implies it's for retrieving features for a specific project, but doesn't mention when to use 'listFlags' (which might list all flags across projects) or 'getFlag' (for a single feature). No prerequisites or exclusions are provided.

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