deleteGroup
Remove a specific group from the Whistle MCP Server by specifying the group name. This tool helps manage proxy configurations and streamline network request operations.
Instructions
删除分组
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupName | Yes | 分组名称 |
Implementation Reference
- src/WhistleClient.ts:263-277 (handler)The core handler function for deleting a group. It sends a POST request to Whistle's `/cgi-bin/rules/remove` endpoint with the group name prefixed by a carriage return (`\r${groupName}`) in the form data to identify it as a group.async deleteGroup(groupName: string): Promise<any> { const formData = new URLSearchParams(); formData.append("list[]", `\r${groupName}`); const response = await axios.post( `${this.baseUrl}/cgi-bin/rules/remove`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }
- src/index.ts:147-157 (registration)Registers the 'deleteGroup' tool with the FastMCP server. Defines the tool's name, description, input schema using Zod, and the execute function that calls the WhistleClient handler and formats the response.server.addTool({ name: "deleteGroup", description: "删除分组", parameters: z.object({ groupName: z.string().describe("分组名称"), }), execute: async (args) => { const result = await whistleClient.deleteGroup(args.groupName); return formatResponse(result); }, });
- src/index.ts:150-152 (schema)Zod input schema for the deleteGroup tool, specifying a single required string parameter 'groupName'.parameters: z.object({ groupName: z.string().describe("分组名称"), }),