Skip to main content
Glama

renameRule

Renames existing rules in the Whistle MCP Server to help users organize and manage proxy configurations more effectively. Update rule names quickly for streamlined proxy server control.

Instructions

重命名规则

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newNameYes规则的新名称
ruleNameYes规则现有名称

Implementation Reference

  • Core handler function that sends a POST request to Whistle's /cgi-bin/rules/rename endpoint to rename a rule, with validation to prevent renaming the 'default' rule.
    async renameRule(ruleName: string, newName: string): Promise<any> {
      // Check if trying to rename the default rule
      if (ruleName.toLowerCase() === "default") {
        throw new Error("Cannot rename the 'default' rule");
      }
    
      const formData = new URLSearchParams();
      formData.append("clientId", `${Date.now()}-1`);
      formData.append("name", ruleName);
      formData.append("newName", newName);
    
      const response = await axios.post(
        `${this.baseUrl}/cgi-bin/rules/rename`,
        formData,
        {
          headers: {
            "Content-Type": "application/x-www-form-urlencoded",
          },
        }
      );
    
      return response.data;
    }
  • src/index.ts:69-80 (registration)
    Registers the 'renameRule' MCP tool with FastMCP, defining name, description, input schema using Zod, and execute function that delegates to WhistleClient instance.
    server.addTool({
      name: "renameRule",
      description: "重命名规则",
      parameters: z.object({
        ruleName: z.string().describe("规则现有名称"),
        newName: z.string().describe("规则的新名称"),
      }),
      execute: async (args) => {
        const result = await whistleClient.renameRule(args.ruleName, args.newName);
        return formatResponse(result);
      },
    });
  • Zod schema defining input parameters for the renameRule tool: ruleName and newName as strings.
    parameters: z.object({
      ruleName: z.string().describe("规则现有名称"),
      newName: z.string().describe("规则的新名称"),
    }),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. '重命名规则' implies a mutation operation but doesn't specify whether this requires special permissions, whether the rename is reversible, what happens to references to the old rule name, or what the tool returns. For a mutation tool with zero annotation coverage, this is insufficient behavioral information.

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 extremely concise at just two characters in Chinese ('重命名规则'), which translates to 'Rename rule'. While it's under-specified in terms of content, as a standalone statement it's front-loaded and wastes no words. Every character serves the core purpose statement.

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, no output schema, and multiple similar rename operations in the sibling list, the description is incomplete. It doesn't explain what happens after renaming, error conditions, or how this differs from 'updateRule'. The combination of mutation nature and lack of structured metadata requires more descriptive content.

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%, with both parameters clearly documented in the schema ('规则的新名称' for newName and '规则现有名称' for ruleName). The description adds no additional parameter information beyond what the schema provides, so it meets the baseline of 3 where the schema does the heavy lifting.

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

Purpose2/5

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

The description '重命名规则' (Rename rule) is a tautology that restates the tool name 'renameRule' without adding specificity. It doesn't explain what type of rule is being renamed, what system this operates in, or how it differs from sibling tools like 'renameGroup' or 'renameValue'. The purpose is stated but lacks distinguishing details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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, when this operation is appropriate, or how it relates to similar tools like 'updateRule' or other rename operations in the sibling list. There's complete absence of usage context.

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