Skip to main content
Glama
cuongtl1992

Unleash MCP (Feature Toggle)

markFeaturesStale

Mark features as stale or active within a specified project using the Feature Toggle system. Manage feature lifecycle by updating stale status to align with project needs.

Instructions

Marks features as stale or not stale in the specified project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featuresYes
projectIdYes
staleYes

Implementation Reference

  • The main handler function for the markFeaturesStale tool, which logs the action, calls the underlying markFeaturesStale function from unleash, handles errors, and returns a structured JSON response.
    export async function handleMarkFeaturesStale({ projectId, features, stale }: { projectId: string; features: string[]; stale: boolean; }) { const action = stale ? 'stale' : 'not stale'; logger.info(`Marking ${features.length} features as ${action} in project '${projectId}'`, { projectId, features, stale }); try { const result = await markFeaturesStale(projectId, features, stale); return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Successfully marked ${features.length} features as ${action} in project '${projectId}'`, data: { features, stale, projectId } }, null, 2) }] }; } catch (error: any) { // Handle errors from the Unleash API const errorMessage = error.response?.data?.message || error.message; const status = error.response?.status; logger.error(`Failed to mark features as ${action}: ${errorMessage}`, { status, projectId, features, stale }); // Return a structured error response return { content: [{ type: "text", text: JSON.stringify({ success: false, message: `Failed to mark features as ${action}: ${errorMessage}`, status: status || 500 }, null, 2) }], isError: true }; }
  • Zod schema defining the input parameters for the markFeaturesStale tool: projectId (string), features (array of strings), stale (boolean).
    export const MarkFeaturesStaleParamsSchema = { /** * The ID of the project containing the features */ projectId: z.string().min(1), /** * Array of feature names to mark as stale or not stale */ features: z.array(z.string().min(1)), /** * Whether to mark features as stale (true) or not stale (false) */ stale: z.boolean() };
  • src/server.ts:223-228 (registration)
    Registration of the markFeaturesStaleTool in the MCP server instance using server.tool().
    server.tool( markFeaturesStaleTool.name, markFeaturesStaleTool.description, markFeaturesStaleTool.paramsSchema as any, markFeaturesStaleTool.handler as any );
  • Core helper function that performs the POST request to the Unleash API endpoint /api/admin/projects/{projectId}/stale to mark features as stale or not stale.
    export async function markFeaturesStale( projectId: string, features: string[], stale: boolean ) { try { const endpoint = `/api/admin/projects/${projectId}/stale`; const payload = { features, stale }; const response = await client.post(endpoint, payload); const action = stale ? 'stale' : 'not stale'; logger.info(`Successfully marked ${features.length} features as ${action} in project '${projectId}'`); return response.data; } catch (error) { logger.error(`Error marking features as ${stale ? 'stale' : 'not stale'} in project '${projectId}':`, error); throw error; }

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