Skip to main content
Glama

createGroup

Creates a new group for organizing and managing Whistle proxy rules and configurations using the Whistle MCP Server. Simplifies proxy management by enabling structured rule grouping.

Instructions

创建新分组

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes分组名称

Implementation Reference

  • The core handler function `createGroup` in WhistleClient class that creates a group by sending a POST request to Whistle's rules/add endpoint, prefixing the group name with a carriage return (\r) to identify it as a group.
    async createGroup(name: string): Promise<any> { const formData = new URLSearchParams(); formData.append("clientId", `${Date.now()}-1`); formData.append("name", `\r${name}`); const response = await axios.post( `${this.baseUrl}/cgi-bin/rules/add`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }
  • src/index.ts:119-129 (registration)
    Registers the 'createGroup' MCP tool using FastMCP's addTool method, defining its name, description, input schema with Zod, and execute handler that delegates to WhistleClient.createGroup.
    server.addTool({ name: "createGroup", description: "创建新分组", parameters: z.object({ name: z.string().describe("分组名称"), }), execute: async (args) => { const result = await whistleClient.createGroup(args.name); return formatResponse(result); }, });
  • Zod schema for the createGroup tool input parameters, requiring a 'name' string for the group name.
    parameters: z.object({ name: z.string().describe("分组名称"), }),

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/7gugu/whistle-mcp'

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