Skip to main content
Glama

removeRuleFromGroup

Remove a specific rule from its group using the Whistle MCP Server. This tool enables precise management of proxy server rules by isolating and deleting unwanted configurations.

Instructions

将规则移出分组

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ruleNameYes规则名称

Implementation Reference

  • src/index.ts:175-185 (registration)
    Registration of the 'removeRuleFromGroup' MCP tool, including schema definition, description, and thin inline handler that delegates to WhistleClient.moveRuleOutOfGroup
    server.addTool({ name: "removeRuleFromGroup", description: "将规则移出分组", parameters: z.object({ ruleName: z.string().describe("规则名称"), }), execute: async (args) => { const result = await whistleClient.moveRuleOutOfGroup(args.ruleName); return formatResponse(result); }, });
  • Core handler logic: Moves the specified rule out of any group by repositioning it next to the first rule in the top-level list via POST to Whistle's /cgi-bin/rules/move-to endpoint.
    async moveRuleOutOfGroup(ruleName: string): Promise<any> { const rules = await this.getRules(); const firstRuleName = rules.list[0].name; const formData = new URLSearchParams(); formData.append("clientId", `${Date.now()}-1`); formData.append("from", ruleName); formData.append("to", firstRuleName); formData.append("group", "false"); const response = await axios.post( `${this.baseUrl}/cgi-bin/rules/move-to`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }
  • Zod schema for tool input: requires 'ruleName' string parameter.
    parameters: z.object({ ruleName: z.string().describe("规则名称"), }),
  • Helper function used by the tool handler to format responses in MCP-expected structure.
    function formatResponse(data: any) { return { content: [ { type: "text" as const, text: JSON.stringify(data), }, ], }; }

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