Skip to main content
Glama
ZhipingYang

FFS MCP Server

by ZhipingYang

ffs_search_flag

Search for Feature Flag Service (FFS) flags using keywords or flag IDs to find matching flags with their identifiers and types.

Instructions

Search for FFS flags by keyword. Returns matching flags with their IDs and types.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesSearch keyword or complete Flag ID

Implementation Reference

  • Core handler logic for ffs_search_flag - the searchFlags function that makes HTTP request to FFS API to search for flags by keyword
    export async function searchFlags(keyword: string): Promise<FfsFlagSearchResult[]> {
      const res = await httpRequest<{ flags: FfsFlagSearchResult[] }>(
        `${FFS_CONFIG.baseUrl}${FFS_ENDPOINTS.flags}/?flagId=${encodeURIComponent(keyword)}`,
        { method: 'GET' }
      );
    
      return res.data.flags || [];
    }
  • src/index.ts:67-114 (registration)
    Tool registration with MCP server - defines tool name, description, input schema using Zod, and inline handler that calls searchFlags
    // Tool 2: ffs_search_flag
    server.tool(
      'ffs_search_flag',
      'Search for FFS flags by keyword. Returns matching flags with their IDs and types.',
      {
        keyword: z.string().describe('Search keyword or complete Flag ID'),
      },
      async ({ keyword }) => {
        try {
          const flags = await searchFlags(keyword);
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify({
                  found: flags.length > 0,
                  count: flags.length,
                  flags: flags.map((f) => ({
                    id: f.id,
                    description: f.description || 'No description',
                    dataType: f.dataType,
                    status: f.status,
                  })),
                  message: flags.length === 0
                    ? 'No flags found. Please check the keyword.'
                    : flags.length === 1
                      ? `Found exact match: ${flags[0].id}`
                      : `Found ${flags.length} flags. Please specify the exact Flag ID.`,
                }, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify({
                  success: false,
                  message: error instanceof Error ? error.message : 'Unknown error',
                }, null, 2),
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Input schema definition using Zod - validates keyword parameter as required string
    {
      keyword: z.string().describe('Search keyword or complete Flag ID'),
    },
  • Type definition for FfsFlagSearchResult - defines the structure of flag search results returned by the handler
    export interface FfsFlagSearchResult {
      id: string;
      description?: string;
      dataType: string;
      status: string;
    }

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/ZhipingYang/ffs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server