Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

getFeatureTypes

Retrieve a comprehensive list of feature types, including descriptions and lifetimes, for effective management within the Unleash Feature Toggle system.

Instructions

Get a list of all feature types with their descriptions and lifetimes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the getFeatureTypes tool, which fetches all feature types using getAllFeatureTypes and returns them as JSON or error.
    async function handleGetFeatureTypes() {
      try {
        // Get all feature types
        const featureTypes = await getAllFeatureTypes();
        
        if (!featureTypes) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                error: "Failed to fetch feature types" 
              }, null, 2)
            }],
            isError: true
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: true,
              count: featureTypes.length,
              featureTypes: featureTypes
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              error: error.message 
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Tool schema/definition exporting the name, description, and handler for getFeatureTypes (no input parameters).
    export const getFeatureTypes = {
      name: "getFeatureTypes",
      description: "Get a list of all feature types with their descriptions and lifetimes",
      handler: handleGetFeatureTypes
    }; 
  • src/server.ts:183-187 (registration)
    Registration of the getFeatureTypes tool on the MCP server using server.tool().
    server.tool(
      getFeatureTypes.name,
      getFeatureTypes.description,
      getFeatureTypes.handler as any
    );
  • Helper function that fetches all feature types from the Unleash API via HTTP GET request.
    export async function getAllFeatureTypes(): Promise<any[] | null> {
      try {
        const response = await client.get('/api/admin/feature-types');
        return response.data || [];
      } catch (error) {
        logger.error('Error fetching feature types:', 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 the full burden of behavioral disclosure. While it states this is a read operation ('Get'), it doesn't mention any behavioral traits such as permissions required, rate limits, pagination, or what happens if no feature types exist. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 what the tool does without any fluff. It's front-loaded with the core purpose and includes all necessary information about what is retrieved. Every word earns its place, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's simplicity (zero parameters, no output schema), the description is adequate but not complete. It explains what is retrieved but lacks details on behavioral aspects like error handling or response format. Without annotations or an output schema, the agent is left guessing about the structure of the returned list, which is a notable gap for a retrieval tool.

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?

The tool has zero parameters, and schema description coverage is 100%, so there's no need for parameter documentation in the description. The baseline for zero parameters is 4, as the description appropriately doesn't waste space discussing non-existent parameters. It focuses on the tool's purpose instead.

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 tool's purpose: 'Get a list of all feature types with their descriptions and lifetimes'. It uses a specific verb ('Get') and identifies the resource ('feature types') along with what information is included ('descriptions and lifetimes'). However, it doesn't explicitly differentiate from sibling tools like 'getFeatureTags' or 'getProjectFeatures', which prevents a perfect score.

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. With siblings like 'getFeatureTags', 'getFlag', and 'getProjectFeatures' that also retrieve feature-related data, there's no indication of when this specific tool is appropriate or what distinguishes it from those options. This leaves the agent without contextual usage instructions.

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