Skip to main content
Glama

createRule

Create custom rules for managing proxies on the Whistle MCP Server. Define rule names to control network requests, monitor traffic, and streamline proxy operations effectively.

Instructions

创建新规则

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes规则名称

Implementation Reference

  • The primary handler function that executes the createRule tool logic by sending a POST request with the rule name to Whistle's /cgi-bin/rules/add endpoint and returning the response data.
    async createRule(name: string): Promise<any> {
      const data = { name };
      const response = await axios.post(
        `${this.baseUrl}/cgi-bin/rules/add`,
        data
      );
      return response.data;
    }
  • src/index.ts:43-53 (registration)
    Registers the 'createRule' MCP tool with the FastMCP server, including its description, Zod input schema, and thin execute wrapper that calls WhistleClient.createRule.
    server.addTool({
      name: "createRule",
      description: "创建新规则",
      parameters: z.object({
        name: z.string().describe("规则名称"),
      }),
      execute: async (args) => {
        const result = await whistleClient.createRule(args.name);
        return formatResponse(result);
      },
    });
  • Zod input schema for the createRule tool, validating a single required 'name' parameter as a string.
    parameters: z.object({
      name: z.string().describe("规则名称"),
    }),
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. '创建新规则' only states the action without any information about permissions required, side effects, whether the creation is immediate or requires activation, error conditions, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is completely inadequate.

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 three Chinese characters. There's no wasted language or unnecessary elaboration. While this conciseness comes at the cost of completeness, as a standalone measure of brevity and structure, it's maximally efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of rule creation in a system with many sibling tools, no annotations, no output schema, and a minimal description, this is severely incomplete. The description fails to explain what rules are, what they control, how they relate to other entities (groups, values), or what the tool returns. It provides insufficient context for effective use.

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 one parameter 'name' documented as '规则名称' (rule name) in the schema. The description adds no additional parameter information beyond what's already in the schema. According to the rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 '创建新规则' (Create new rule) is a tautology that essentially restates the tool name 'createRule' in Chinese. While it indicates the tool creates rules, it doesn't specify what kind of rules, what system they belong to, or how they differ from sibling tools like 'updateRule' or 'createGroup'. The purpose is vague beyond the basic verb-object structure.

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. With multiple sibling tools like 'updateRule', 'createGroup', 'addRuleToGroup', and 'deleteRule', there's no indication of prerequisites, appropriate contexts, or distinctions between creating a rule versus updating or adding to groups. This leaves the agent without direction for tool selection.

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