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 );

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