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;
      }
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 the action but doesn't disclose behavioral traits such as required permissions, whether changes are reversible, effects on related data, or error handling. For a mutation tool with zero annotation coverage, this is a significant gap.

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 front-loads the core action without unnecessary words. Every part of the sentence contributes directly to explaining the tool's purpose, making it appropriately sized and well-structured.

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 the tool's complexity as a mutation with 3 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavior, parameter meanings, return values, and usage context, leaving significant gaps for an AI agent to understand and invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/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 'features' and 'projectId' but doesn't explain what constitutes a feature or project ID, nor does it clarify the 'stale' boolean's meaning (e.g., true for stale, false for not stale). The description adds minimal value beyond the schema's parameter names.

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 ('marks') and resource ('features'), specifying the action of setting stale status in a project. It distinguishes from siblings like 'archiveFlag' or 'disableFlag' by focusing on stale marking rather than archival or state changes, though it doesn't explicitly contrast with them.

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 guidance is provided on when to use this tool versus alternatives like 'archiveFlag' or 'disableFlag', nor are prerequisites or exclusions mentioned. The description implies usage for marking features as stale/not stale but lacks context for decision-making.

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