Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

getEnvironments

Retrieve all configured environments in the Unleash Feature Toggle system to manage and audit feature flag settings across different contexts.

Instructions

Get a list of all environments configured in Unleash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the getEnvironments tool logic: fetches all environments using getAllEnvironments and formats the response as JSON.
    async function handleGetEnvironments() {
      try {
        // Get all environments
        const environments = await getAllEnvironments();
        
        if (!environments) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({ 
                success: false,
                error: "Failed to fetch environments" 
              }, null, 2)
            }],
            isError: true
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: true,
              count: environments.length,
              environments: environments
            }, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              success: false,
              error: error.message 
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Tool schema definition with name, description, and reference to the handler function.
    export const getEnvironments = {
      name: "getEnvironments",
      description: "Get a list of all environments configured in Unleash",
      handler: handleGetEnvironments
    }; 
  • src/server.ts:189-193 (registration)
    Registration of the getEnvironments tool on the MCP server.
    server.tool(
      getEnvironments.name,
      getEnvironments.description,
      getEnvironments.handler as any
    );
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 retrieves a list but doesn't disclose behavioral traits like whether it requires authentication, has rate limits, returns paginated results, or what format the list comes in. For a tool with zero annotation coverage, this is inadequate.

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 wasted words. It's front-loaded with the core purpose and efficiently communicates what the tool does without unnecessary elaboration.

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 and no output schema, the description is incomplete. It doesn't explain what an 'environment' means in Unleash context, what data the list contains, or how results are structured. For a tool that likely returns important configuration data, more context is needed.

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 0 parameters with 100% schema description coverage, so the schema already fully documents the lack of parameters. The description doesn't need to add parameter information, and it correctly implies no parameters are needed by not mentioning any. This meets the baseline for zero-parameter tools.

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 a list of') and resource ('all environments configured in Unleash'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'getProjects' or 'getFeatureTypes' which also retrieve lists of resources, so it doesn't reach the highest 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 sibling tools like 'getProjects' and 'getFeatureTypes' that also retrieve lists, there's no indication of when this specific tool is appropriate or what distinguishes it from other list-retrieval tools.

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