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),
          },
        ],
      };
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states the action ('remove rule from group') without any information about side effects (e.g., whether this affects rule functionality, if it's reversible, or what happens to the rule after removal), permissions required, or error conditions. This is inadequate for a mutation tool with zero annotation coverage.

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 phrase ('将规则移出分组') that directly conveys the tool's purpose without unnecessary words. It's appropriately sized for a simple operation and front-loaded with the core action, making it easy to parse quickly.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks crucial behavioral context (e.g., what 'remove' entails, side effects, or return values) and doesn't compensate for the absence of structured fields. While concise, it fails to provide enough information for safe and effective use by an AI agent.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the 'ruleName' parameter is documented in the schema as '规则名称' - rule name), so the baseline is 3. The description doesn't add any parameter details beyond what the schema provides, such as format examples or constraints, but it doesn't need to since the schema is complete. No parameters are omitted or misunderstood.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '将规则移出分组' (Remove rule from group) clearly states the action (remove) and target (rule from group), which is better than a tautology. However, it doesn't specify what 'group' refers to in this context or differentiate from sibling tools like 'removeValueFromGroup', leaving some ambiguity about the exact resource being manipulated.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the rule must already be in a group), when not to use it, or refer to related tools like 'addRuleToGroup' or 'deleteRule' for context. The agent must infer usage from the tool name alone.

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

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